web3.js
web3.js copied to clipboard
Transient dependency on safer-buffer breaks builds that polyfill with rollup
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
When running web3.js in the browser via a react app served with snowpack I get this error:
Expected Behavior
Should be able to polyfill buffer using rollup.
Steps to Reproduce
npx create-snowpack-app react-snowpack --template @snowpack/app-template-minimal
cd react-snowpack
yarn add web3
echo "import web3 from 'web3'" >> index.js
echo "const web3 = new Web3(window.ethereum)" >> index.js
- Edit package.json and set snowpack version to
3.8.6
- Add
polyfillNode: true
to thepackageOptions
array in `snowpack.config.mjs' - Run
yarn start
Web3.js Version
1.7.3
Environment
- Operating System: NixOS
- Browser: Firefox
- Node.js Version: 18.1.0
- NPM Version: Yarn 1.22.18
Anything Else?
The dependencies that transiently depend on safer-buffer
:
- crypto-browserify
- express > body-parser > raw-body > iconv-lite
- request > http-signature > sshpk
- browserify-sign > parse-asn1 > asn1.js
Related Issues:
Hey thanks for submitting this issue, what is specifically causing this issue? crpyto-browserify?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.