I'm constantly getting this error message and don't have a clue how to solve it:
Can anyone please help me?
CodePudding user response:
The thing is Webpack v5 no longer adds polyfills for Node.js built-ins and you should choose between:
- install polyfills and resolve them; or
- turn them off using new Webpack API.
If you choose the second option, use the Putout code transformer I’m working on, it will fix all the things for you with help of @putout/plugin-webpack
. Here is what it looks like:
convert-node-to-resolve-fallback
fixes webpack compilation error:
Module not found: Error: Can't resolve 'path'`
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
Incorrect code:
module.exports = {
node: {
path: 'empty',
},
};
Correct code:
module.exports = {
resolve: {
fallback: {
path: false,
},
},
};
CodePudding user response:
This is my whole error: