apibara / starknet-react

A collection of React providers and hooks for StarkNet
https://starknet-react.com
MIT License
369 stars 147 forks source link

`TypeError` when trying to use connectors #267

Closed tvinagre closed 1 year ago

tvinagre commented 1 year ago

Whenever I try to add starknet-react to a project, I get this runtime error:

(0 , get_starknet_core_1.getStarknet) is not a function
TypeError: (0 , get_starknet_core_1.getStarknet) is not a function
    at InjectedConnector.ensureWallet (http://localhost:3000/static/js/bundle.js:1830:58)
    at InjectedConnector.available (http://localhost:3000/static/js/bundle.js:1752:10)
    at http://localhost:3000/static/js/bundle.js:2683:49
    at Array.filter (<anonymous>)
    at http://localhost:3000/static/js/bundle.js:2683:29
    at commitHookEffectListMount (http://localhost:3000/static/js/bundle.js:61367:30)
    at commitPassiveMountOnFiber (http://localhost:3000/static/js/bundle.js:62860:17)
    at commitPassiveMountEffects_complete (http://localhost:3000/static/js/bundle.js:62832:13)
    at commitPassiveMountEffects_begin (http://localhost:3000/static/js/bundle.js:62822:11)
    at commitPassiveMountEffects (http://localhost:3000/static/js/bundle.js:62812:7)

I'm using Node v18.16.0 and the package's latest version "@starknet-react/core": "^0.18.0"

I've used yarn to add the package

fracek commented 1 year ago

This looks like a duplicate of #245. There is a workaround to use the library with create-react-app.

Feel free to reopen the issue if you're not using create-react-app.

tvinagre commented 1 year ago

Thank you! That was indeed the issue and I was able to fix with config-overrides