web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Transient dependency on safer-buffer breaks builds that polyfill with rollup

Open JonathanLorimer opened this issue 2 years ago • 2 comments

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: 1653232319_grim

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 the packageOptions 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:

JonathanLorimer avatar May 22 '22 15:05 JonathanLorimer

Hey thanks for submitting this issue, what is specifically causing this issue? crpyto-browserify?

luu-alex avatar Jun 03 '22 17:06 luu-alex

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.

github-actions[bot] avatar Aug 03 '22 00:08 github-actions[bot]