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

Viewed 3921

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.

1 Answers

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.

Related