9

I'm trying to make an ecommerce 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.

7
  • What's your Node.js version? Commented Jun 4, 2022 at 14:31
  • @yousoumar My node version is v14.17.1 Commented Jun 4, 2022 at 14:34
  • Does this answer your question? Module build failed (from ./node_modules/html-loader/dist/cjs.js): Commented Jun 4, 2022 at 14:38
  • No! that's not my question. Commented Jun 4, 2022 at 14:47
  • I see. You are using npm to install the packages, right ? Commented Jun 4, 2022 at 14:49

6 Answers 6

8

Delete your node_module folder and then run

 npm i

It solves the problem for me

Sign up to request clarification or add additional context in comments.

Comments

6

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.

1 Comment

LOL im glad we still have SO ai could't solve this but good old humans did. i miss these od days when i relied on SO for my work
-1

I was reinstall my package.json without delating node_modules and it worked:

just write this :

npm i

1 Comment

For me it was also necessary to restart the dev server.
-1

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 command. Once you've installed the module, you should be able to build your app without encountering this error.

Comments

-1
  • 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

Comments

-2

With the same issue, i just quited from vs code and restarted it, followed with npm start, solved.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.