I'm trying to make an emerce website with React. And it was working perfectly but after I install redux
and react-redux
, I'm getting this error:
Uncaught Error: Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open 'D:\ProgrammingHero\foodie\client\node_modules\core-js-pure\modules\esnext.global-this.js'
at ./node_modules/core-js-pure/modules/esnext.global-this.js (global-this.js:6:1)
at options.factory (startup:7:1)
at __webpack_require__ (jsonp chunk loading:133:1)
at fn (jsonp chunk loading:367:1)
at ./node_modules/core-js-pure/full/global-this.js (global-this.js:2:1)
at options.factory (startup:7:1)
at __webpack_require__ (jsonp chunk loading:133:1)
at fn (jsonp chunk loading:367:1)
at ./node_modules/core-js-pure/features/global-this.js (global-this.js:1:1)
at options.factory (startup:7:1)
But if I uninstall redux
and react-redux
it works perfectly.
I'm trying to make an emerce website with React. And it was working perfectly but after I install redux
and react-redux
, I'm getting this error:
Uncaught Error: Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open 'D:\ProgrammingHero\foodie\client\node_modules\core-js-pure\modules\esnext.global-this.js'
at ./node_modules/core-js-pure/modules/esnext.global-this.js (global-this.js:6:1)
at options.factory (startup:7:1)
at __webpack_require__ (jsonp chunk loading:133:1)
at fn (jsonp chunk loading:367:1)
at ./node_modules/core-js-pure/full/global-this.js (global-this.js:2:1)
at options.factory (startup:7:1)
at __webpack_require__ (jsonp chunk loading:133:1)
at fn (jsonp chunk loading:367:1)
at ./node_modules/core-js-pure/features/global-this.js (global-this.js:1:1)
at options.factory (startup:7:1)
But if I uninstall redux
and react-redux
it works perfectly.
- What's your Node.js version? – Youssouf Oumar Commented Jun 4, 2022 at 14:31
- @yousoumar My node version is v14.17.1 – loserarif Commented Jun 4, 2022 at 14:34
- Does this answer your question? Module build failed (from ./node_modules/html-loader/dist/cjs.js): – Youssouf Oumar Commented Jun 4, 2022 at 14:38
- No! that's not my question. – loserarif Commented Jun 4, 2022 at 14:47
- I see. You are using npm to install the packages, right ? – Youssouf Oumar Commented Jun 4, 2022 at 14:49
6 Answers
Reset to default 6Delete your node_module
folder and then run
npm i
It solves the problem for me
Hi for the future people, I think I found the solution.
Modules will have these errors when you install them while running the application. Just exit the live share and run it again you should be fine.
I was reinstall my package.json without delating node_modules and it worked:
just write this :
npm i
This error message indicates that there was a problem with the source-map-loader module while building your React app. The source-map-loader module is used to load and integrate source maps into webpack bundles, and it is typically used in development environments to improve debugging.
You are getting this error because the source-map-loader module is not installed: The source-map-loader module is not installed by default in a React app, so you need to install it manually using the npm install source-map-loader
or yarn add source-map-loader mand. Once you've installed the module, you should be able to build your app without encountering this error.
- Uninstall the corresponding library that is throwing the error. (In my case it was history library)
- Try to install the matching versions of the required library. (Sometimes the latest version of some library won't work well with the current configs of other libraries.
- Quit the server and re run again
With the same issue, i just quited from vs code and restarted it, followed with npm start, solved.