cryptocoinjs / keccak

Keccak sponge function family
MIT License
86 stars 24 forks source link

Transform not found? #21

Closed liaoqifeng closed 3 years ago

liaoqifeng commented 3 years ago

Uncaught (in promise) TypeError: Class extends value undefined is not a constructor or null

const { Transform } = require('stream')

Why?

fanatid commented 3 years ago

What is your environment? browser / node / node version / tools

maximgeerinck commented 3 years ago

Ran into a similar issue, was using a backend library (eth-sig-util) on the frontend. Using ethersJS alternative fixed it for me.

fanatid commented 3 years ago

If you use webpack as a bundler, do you have resolve.fallback to the stream module? https://webpack.js.org/configuration/resolve/#resolvefallback

ghost commented 3 years ago

@liaoqifeng This error occurs because stream is unstable due to your node version. Therefore I recommend to use the readable-stream module instead of stream.

In #22 you can see what changes need to be applied in order to solve this issue.

If the maintainer of this repo does not decide to replace stream with readable-stream you can use patch-package to edit the node module yourself.