-
Notifications
You must be signed in to change notification settings - Fork 27
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
ReferenceError: Buffer is not defined #27
Comments
This issue is related to using Webpack 5 instead of Webpack 4. Reverting to Webpack 4 (on alex99y's advice) fixed it. However, it is not working for anyone using Webpack 5. |
+1 |
In the next version, we will fix this issue. Now, webpack v5 does not parse Buffer type, for those that prefer webpack v5 to webpack v4 here I found a temporal solution: I will keep this issue open until the problem has been solved in the next release. |
What I am doing is using Buffer from EDIT: yeah, does the same thing when I switched to the plugin and stuff from the reac-pdf comment, no error with |
I hit this issue when updating the Reach stdlib from webpack 4 to webpack 5. From the perspective of a
I believe the fix from the library's perspective is to add the explicit import of |
Resolved my issue with this https://viglucci.io/how-to-polyfill-buffer-with-webpack-5
|
I was able to fix it with @DanBurton's workaround. The webpack settings alone don't seem to fix it. |
…h MyAlgo ~Workaround Ideally MyAlgo should fix it, then we might be able to revert this commit. See randlabs/myalgo-connect#27 Workaround see randlabs/myalgo-connect#27 (comment) https://stackoverflow.com/a/71205013
I followed the steps for the My Algo Connect setup, and most of it was working (such as the popup to connect), but when it came to sign a transaction I was getting the error
ReferenceError: Buffer is not defined at MyAlgoConnect.signTransaction (webpack://algodex/./node_modules/@randlabs/myalgo-connect/lib/main.js?:329:35)
.I managed to fix this with a hack on line 11 in @randlabs/myalgo-connect/lib/main.js:
window.Buffer = window.Buffer || require('buffer').Buffer;
This looks like some dependency problem where NPM for MyAlgoConnect doesn't install the node module for Buffer as a sub-dependency of it. However, I'm not an NPM expert, so not sure why this happened.
The text was updated successfully, but these errors were encountered: