Closed keval6706 closed 2 years ago
same error here
Can you provide a link to your repo, or if not, at least your full package.json?
It looks like what's happening is that your Webpack config isn't handling / transpiling the @solana/wallet-adapter-*
ESM modules. I don't know what the root cause is though, because I can't test out the code.
https://stackoverflow.com/questions/54043498/how-to-transpile-node-modules-modules-with-babel-loader and https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ may be of help. By default, Webpack probably doesn't pass dependencies in node_modules
through a transpiling loader (usually Babel). You need to configure it to do so.
my problem is with nextjs v12 ... look like need to add those modules to next.config... im figuring how to do it
fixed... i followed this solution https://github.com/solana-labs/wallet-adapter/blob/master/packages/starter/nextjs-starter/next.config.js
Hello @jordansexton
Please refer this link: https://codesandbox.io/s/nostalgic-euclid-1etnh?file=/src/App.js
In sandbox i can open modal but with no image and undefined label.
I'm getting the same error, I'm using antdesign with craco.
@keval6706 somehow this error is because of react-scripts version 5.0.0, I installed 4.0.3 its works fine.
@tayab2468 i have checked with "react-scripts": "4.0.3"
but issue is same.
please share codesandbox if possible.
Hello @jordansexton
Please refer this link: https://codesandbox.io/s/nostalgic-euclid-1etnh?file=/src/App.js
In sandbox i can open modal but with no image and undefined label.
I'm getting this same issue using "react-scripts": "4.0.3"
. No icons load and no functionality. Any fixes?
Please refer this link: https://codesandbox.io/s/nostalgic-euclid-1etnh?file=/src/App.js
Thanks for providing this. I took a look. What's happening is that the example code in the readme is out of date with the published versions of the packages. It should work when I publish a few of them, working on it now.
Just published:
@solana/wallet-adapter-wallets@0.14.0
Please upgrade your versions and let me know if this fixes the issues for you!
Also worth noting -- configuration for transpiling the modules is no longer required. See https://github.com/solana-labs/wallet-adapter/blob/master/packages/starter/nextjs-starter/next.config.js which has these removed now.
ESM and CJS versions of all relevant (non-starter) packages are included in the published versions now!
Thanks @jordansexton It's working after upgrade packages :)
Thanks @jordansexton It's working after upgrade packages :)
Can you share me full package after you upgraded because it didn't fix for me
@systemis please check out https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/nextjs-starter to see if your project configuration matches what's in here. If you can't fix the issue, please open a new issue with a link to your repository that reproduces the issue.
Have same issue with react-scripts
I too am having the exact same issue with the upgraded packages and React-Scripts @ 5.0.0.
@systemis @Findiglay @the-fool please try this: https://github.com/solana-labs/wallet-adapter/issues/236#issuecomment-1004071552
Also please check the config in https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/react-ui-starter which uses CRA.
As noted in https://github.com/solana-labs/wallet-adapter/issues/236, there's an issue with CRA 5. Upgrading to package versions that aren't supported isn't recommended.
If you've done all these things and still have an issue, please open a new issue with a reproduction of your problem. Multiple users commenting with possibly different, unrelated issues inside of an already closed issue is difficult to manage. Thanks!
@jordansexton I literally ran into this issue (new to using this btw) and after some googling, came across this post. I was just following this tutorial and kept getting the useWallet
error
I fixed my issue 2 fold in package.json
react-scripts: 4.0.3
(was at 5.0.0
)"browserslist": {
"production": [
"defaults"
],
"development": [
"defaults"
]
}
After that I was able to do npm run start
on the sample and it fired up the app in firefox. Hope this helps anyone running into the same issue.
Glad you figured it out, thanks for posting the solution!
@jordansexton can confirm that browserlists fix works with react-scripts v4.0.3 but not with v5.0.0
@Findiglay see https://github.com/solana-labs/wallet-adapter/issues/241#issuecomment-1006239019, CRA 5 support is blocked until Craco supports it.
Not sure what i am doing wrong.
My
package.json
My
config-overrides.js
fileMy wallet connect file code.