-
Notifications
You must be signed in to change notification settings - Fork 71
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
webpack 5: ReferenceError: Buffer is not defined #216
Comments
Thanks for reporting this! |
Merged
There is now a PR to fix this: #217 |
mirceanis
pushed a commit
that referenced
this issue
Jan 27, 2022
🎉 This issue has been resolved in version 5.12.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Current Behavior
When using did-jwt with webpack 5, the following error shows up: "ReferenceError: Buffer is not defined", since Buffer is not included in the browser.
Failure Information
There are several references to the use of "Buffer.from" in the did-jwt code: https://github.com/decentralized-identity/did-jwt/search?q=%22Buffer.from%22
Alternatives you considered
Based on what I could find, these could be replaced to use "u8a.fromString" instead for better compatibility.
In the meantime I applied a polyfill using this guide, which cleared the issue: https://viglucci.io/how-to-polyfill-buffer-with-webpack-5
The text was updated successfully, but these errors were encountered: