1

Error: Unable to resolve module crypto from SolanaMobileDAppScaffold\node_modules@bundlr-network\client\build\common\transaction.js: crypto could not be found within the project or in these directories: node_modules@bundlr-network\client\node_modules

Metaplex-sdk/js and Project-serum/anchor both experience issues with the following packages in React Native:

  • Crypto
  • Assert
  • StringDecoder
  • Stream

These node libraries require polyfill and are not compatible with React Native.

1 Answer 1

1

The solution by https://github.com/BoxInThePARK/mobile-nft-mint-example is as follows:

In package.json, add:

node-libs-react-native": "^1.2.1"

In metro.config.js

resolver: {
     extraNodeModules: require('node-libs-react-native')
},

Make sure your server is stopped. Delete your node_modules and package-lock.json and reinstall.

Shoutout to Mike Sulistio for the resources

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.