resolve.fallback was introduced in Webpack 5. Check your package.json to see which version of webpack you have. If it says it's using 5, go into your node_modules folder and look for webpack there. It will have its own package.json file with the version listed. Sometimes things just get out of sorts with node_modules, and the best thing you can do is delete that folder and the package-lock.json, then reinstall with npm i.
Thank you! I also discovered my react was incorrect! So I deleted the node modules and the package.json... my next question is: Do I need to also delete the package-lock.json? Seems logical...
Top comments (5)
Sounds like the webpack.config.js doesn't match the version of webpack in your node package manager.
resolve.fallback was introduced in Webpack 5. Check your package.json to see which version of webpack you have. If it says it's using 5, go into your node_modules folder and look for webpack there. It will have its own package.json file with the version listed. Sometimes things just get out of sorts with node_modules, and the best thing you can do is delete that folder and the package-lock.json, then reinstall with
npm i
.Thank you! I also discovered my react was incorrect! So I deleted the node modules and the package.json... my next question is: Do I need to also delete the package-lock.json? Seems logical...
You can. It will generate a new one for you when you install.
thanks again!