-
Notifications
You must be signed in to change notification settings - Fork 4.6k
./node_modules/@solana/buffer-layout-utils/lib/esm/web3.mjs Can't import the named export 'PublicKey' from non EcmaScript module (only default export is available) #25197
Comments
Version 1.7.0 is rather old (current version is 1.41.8) and I believe from before a time that we fixed a lot of these ESModule-adjacent build errors. Are you able to upgrade web3.js to a newer version and try again? |
I am also receiving this error on build solana/web3.js v1.41.10 |
If you have a sample repository that exhibits this, or a small set of steps to reproduce, I’ll take a look and try to debug! |
Same here, got the same issue today after adding React Moralis Provider, but removing Moralis Provider wrapper from my code fixing this issue Web3.js Version
or
Environment
|
Can you folks send me a link to a GitHub repository that I can clone, run, and reproduce the problem? |
Step 1: Clone Step 2: Delete Step 3: Run Step 4: Run I used these steps and was able to replicate, see this repo: @steveluscher when you get a chance :) |
I have same problem, updated to newest libs and it happened:
after npm start:
|
This issue is since solana-labs/solana-web3.js@980f460 |
This fixed it for me anza-xyz/wallet-adapter#265 (comment) |
@michalko nailed it. We simply have moved on to ESModules, and Create React App version 4 is no longer supported out-of-the-box. The solution is to follow the steps in anza-xyz/wallet-adapter#265 (comment). |
Ahh Ive been using this off and on and it didnt even occur to me since its usually a different package. Thanks! |
I'm trying to follow the steps in solana-labs/wallet-adapter#265 (comment), but I'm getting the below error when running this command
|
@barhouum7 just open |
Thanks for the reply, even in the dependencies, should I change the dependency name of react-scripts? or just change it in my scripts? |
I don't remember, but they have you covered with setup instructions! https://github.com/timarney/react-app-rewired |
Followed your solution mentioned here anza-xyz/wallet-adapter#265 (comment), and it helped me to fix this issue. Thanks! |
At this point, it's time to take the questions to Discord where your problem can get more eyes on it! https://discord.gg/cVjnnQVg |
./node_modules/@liqnft/candy-shop-sdk/node_modules/@solana/spl-token/lib/esm/actions/createMint.mjs |
Current Behavior
AWS fails to build the website citing this error.
Did a fresh install locally to replicate the error. Seems like web3 forcing the installation of this module when it didn't previously.
Expected Behavior
Build successful without facing this issue.
Steps to Reproduce
npm install
Web3.js Version
1.7.0
Environment
Operating System: Windows
Browser: Brave/Chrome
Node.js Version: 16.4.0
NPM Version: 7.18.1
Anything Else?
The text was updated successfully, but these errors were encountered: