DEV Community

Discussion on: The Complete Guide to Full Stack Solana Development with React, Anchor, Rust, and Phantom

Collapse
 
hypeman profile image
hype • Edited

If you end up with

Module not found: Error: Can't resolve './adapter' in '/Users/me/Desktop/mysolanaapp/app/node_modules/@solana/wallet-adapter-bitkeep/lib'
Did you mean 'adapter.js'?
BREAKING CHANGE: The request './adapter' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request." 
Enter fullscreen mode Exit fullscreen mode

Error, its probably because of create-react-app using "react-scripts": "5.0.0", in order to fix - downgrade to "react-scripts": "^4.0.3" or do manual webpack hacking
source: giters.com/solana-labs/wallet-adap...
and github.com/reduxjs/redux/issues/4174

Collapse
 
walkre profile image
walkre • Edited

I changed "react-scripts": "5.0.0" into "react-scripts": "4.0.3" and I got the following error at Building the React app when I run npm start.
Anyone could help me?

Failed to compile.

./node_modules/@solana/wallet-adapter-base/lib/esm/signer.js 16:16
Module parse failed: Unexpected token (16:16)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|           ...sendOptions
|         } = options;
>         signers?.length && transaction.partialSign(...signers);
|         transaction = await this.signTransaction(transaction);
|         const rawTransaction = transaction.serialize();
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mengni profile image
How

I followed the dowgrade instruction for all dependencies, but still got the following error:

Failed to compile.

./src/App.js
Attempted import error: 'PhantomWalletAdapter' is not exported from '@solana/wallet-adapter-wallets'.

Could someone help with this? Thanks!

Collapse
 
jdguzmans profile image
jdguzmans

@walkre I am having the same error, did you solve this?

Thread Thread
 
walkre profile image
walkre

Sadly, no.

Thread Thread
 
jdguzmans profile image
jdguzmans

with these dependencies it worked for me
...
"@solana/wallet-adapter-base": "^0.7.1",
"@solana/wallet-adapter-react": "^0.13.1",
"@solana/wallet-adapter-react-ui": "^0.6.1",
"@solana/wallet-adapter-wallets": "^0.11.3",
"@solana/web3.js": "^1.31.0",
...
"react-scripts": "4.0.3",

Thread Thread
 
walkre profile image
walkre

That worked for me too.
Thank you very much!!!

Collapse
 
chillnarmadillo profile image
chillnArmadillo

Cheers mate! Made my day.

Collapse
 
mcintyre94 profile image
mcintyre94

This Alchemy tutorial is a really good guide to the manual webpack hacking: alchemy.com/blog/how-to-polyfill-n...

You only need these overrides:

Object.assign(fallback, {
    "crypto": require.resolve("crypto-browserify"),
    "stream": require.resolve("stream-browserify"),
  })
Enter fullscreen mode Exit fullscreen mode
Collapse
 
shoaib7889 profile image
Muhammad Shoaib

Saved