-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Buffer not defined with Webpack 5 #1446
Comments
Can you explain more? Maybe you can create reproducible example for the issue you're reporting? Note that there are no active maintainer that can write code right now, the original author of the library is not actively working on the project (recently he added one PR). So if you will not willing to fix the issue yourself, it will probably be not fixed for a while, especially that you don't say what is the exact issue. Unless someone else that needed it will fix the issue for you. |
I ran into the same after updating CRA. The problem is that Webpack 5 no longer polyfills node packages. The packages need to be installed manually and added to the module.exports = {
//...
resolve: {
fallback: {
buffer: require.resolve('buffer'),
process: require.resolve('process/browser'),
stream: require.resolve('stream-browserify'),
},
},
}; You will also need to add these plugins: const webpack = require('webpack');
module.exports = {
// ...
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
} |
It seems like we can close this issue. Did that work for you @bojanvidanovic? |
Maybe it's worth adding this to FAQ before closing. |
Oh yes, that solves the issue. But as @jcubic mentioned, it should be documented. |
Incompatibility with Webpack 5, whereas it will throw an error "Buffer not defined".
The text was updated successfully, but these errors were encountered: