ningster
ningster

Reputation: 33

React: Module build failed (from ./node_modules/source-map-loader/dist/cjs.js)

here is the error msg from console:

Error: ENOENT: no such file or directory, open 'C:\Code\django\DRF-REACT\node_modules\prop-types\node_modules\react-is\index.js' at Object.../node_modules/prop-types/node_modules/react-is/index.js (has.js:1:1)

at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at Object.../node_modules/prop-types/index.js (index.js:9:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at Module.../node_modules/@material-ui/core/esm/AppBar/AppBar.js (log.js:59:1)
at Module.options.factory (react refresh:6:1)

The problem is >react-is is outside of prop-types/node_modules and prop-types/node-modules is an empty folder. I tried to move the react-is into the node modules folder in Vscode but it cannot be done.

Upvotes: 3

Views: 22042

Answers (6)

Balaji Venkatraman
Balaji Venkatraman

Reputation: 1337

  1. Delete node_modules
  2. Delete package.lock.json
  3. run npm clean cache
  4. run npm i
  5. Then run npm start

Upvotes: 0

Lakhan Pahane
Lakhan Pahane

Reputation: 1

close the vs code, close the application and restart both, it works properly.. :) Goes the error...!

Upvotes: 0

osman
osman

Reputation: 19

I only used another (port) and restart my application using command(npm start). after that the problem was solved

Upvotes: 0

u4ii4y984484y203r
u4ii4y984484y203r

Reputation: 65

Simply closing VS Studio and running npm start solved the problem for me.

Upvotes: 0

Krishnamoorthy Acharya
Krishnamoorthy Acharya

Reputation: 4254

Following steps resolved the issue in my react application

  1. Closed VS studio

  2. Run the following commands

    npm update 
    npm audit fix
    npm start 
    

Upvotes: 3

sid_mac
sid_mac

Reputation: 341

You might have some complications with your node_modules folder and installing react-is.

A couple ideas:

  1. npm install react-is : make sure the package is installed instead of physically moving it.

  2. rm -rf node_modules : delete node_modules folder and do a fresh npm install

One or both of these could help if you haven't done them already.

Upvotes: 2

Related Questions