Closed neoncube2 closed 3 years ago
I think this is probably a signal what csv-parser
may want to export different things for use with browsers vs. node.
Anyway, if anyone else is trying to get this to work with Webpack 5, here are the magic things that you need to put into webpack.config.js
:
module.exports = {
resolve: {
'stream': require.resolve('stream-browserify'),
'events': require.resolve('events/')
}
},
plugins: [
new webpack.ProvidePlugin({
'Buffer': ['buffer', 'Buffer']
}),
],
}
Then you also need to put stream-browserify
, events
, and buffer
as dependencies
in package.json
Webpack 5 removes the node compatibility layer for browsers. Please read release notes for major versions. It's now on you to include that manually or implement the proper polyfills. It is not the responsibility of packages to provide browser compatibility
Webpack 5 was released a few days ago.
After upgrading, I'm getting this error:
Not sure what the best for
csv-parser
to fix this is, but I thought I'd mention it 🙂