-
-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage without polyfills #212
Comments
The bug is in vite; a non-broken node module bundler provides browser polyfills for node core modules that can work in the browser, including stream. |
I think you are right because I just checked and it works with create react apps webpack config. If the target audience is browser users who don't have access to node crypto wouldn't it make sense to make the whole package browser compatible out of the box? |
It’s already browser compatible - when used with a non-broken bundler. This is how the node ecosystem has worked for over a decade - it’s just that a few bundlers have recently decided to break this tradition and hurt users. |
|
For anyone running into this issue I found this package: https://github.com/davidmyersdev/vite-plugin-node-polyfills. I tested it out using |
@secondl1ght i haven't audited that package either, but if it can fix vite's broken omission of node polyfills, then that seems like the appropriate solution. |
the library cipher-base from browserify-sign is using node js internal module 'stream'
which is not available in the browser.
I have come up with a fix for now which is to patch require('stream') to be require('readable-stream'), but it's not very elegant.
To reproduce:
Expected:
Actual:
The text was updated successfully, but these errors were encountered: