1

My Application was working fine but when I installed material ui npm package my application is giving me this error.

 Html Webpack Plugin:
  Error: Child compilation failed:
  Module build failed (from ./node_modules/babel-loader/lib/index.js):
  Error: [BABEL] C:\ReactJS work\React Projects\portfolio\node_modules\webpack\b  uildin\global.js: Cannot find module './src/data'
  Require stack:
  - C:\ReactJS work\React Projects\portfolio\node_modules\core-js-compat\helpers  .js
  - C:\ReactJS work\React Projects\portfolio\node_modules\core-js-compat\get-mod  ules-list-for-target-version.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\babel-preset-react-app  \node_modules\@babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\babel-preset-react-app  \node_modules\@babel\preset-env\lib\index.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\babel-preset-react-app  \dependencies.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\@babel\core\lib\config  \files\plugins.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\@babel\core\lib\config  \files\index.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\@babel\core\lib\index.  js
  - C:\ReactJS work\React Projects\portfolio\node_modules\babel-loader\lib\index  .js
  - C:\ReactJS work\React Projects\portfolio\node_modules\loader-runner\lib\load  Loader.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\loader-runner\lib\Load  erRunner.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\webpack\lib\NormalModu  le.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\webpack\lib\NormalModu  leFactory.js
  - C:\ReactJS work\React Projects\portfolio\node_modules\webpack\lib\Compiler.j  s
  - C:\ReactJS work\React Projects\portfolio\node_modules\webpack\lib\webpack.js  - C:\ReactJS work\React Projects\portfolio\node_modules\react-scripts\scripts\  start.js (While processing: "C:\\ReactJS work\\React Projects\\portfolio\\node  _modules\\babel-preset-react-app\\dependencies.js$0$9")

  - loader.js:794 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:794:15

  - loader.js:687 Function.Module._load
    internal/modules/cjs/loader.js:687:27

  - loader.js:849 Module.require
    internal/modules/cjs/loader.js:849:19
Michael Abeln
  • 2,518
  • 10
  • 20
Hammad Hassan
  • 606
  • 7
  • 20
  • Do you have or intend to have a file such as `data.js` or similar that you are trying to import and use in your code? – Alexander Staroselsky Dec 02 '19 at 18:42
  • Can you upload your webpack config file please? It would also be helpful to see your package.json file – Michael Abeln Dec 02 '19 at 18:42
  • @AlexanderStaroselsky No, I don't want to add any data.js file. I just started to make this. It was working well initially but when just I installed material ui npm it crashes – Hammad Hassan Dec 02 '19 at 18:46

2 Answers2

4

It looks like there's been a bad build of npm package core-js-compat. This is a deep-down dependency of Babel. Lots of things will be affected, things that use Babel. It's not specifically to do with material-ui -- you were just unfortunate to update your npm package versions while a bad build was live.

You will experience the problem if you have core-js-compat v.3.4.6. You can check this by doing npm list core-js-compat. The problem is apparently fixed by v.3.4.7, which was pushed out pretty quickly, about half-an-hour later, but unfortunately it takes a while to spread out through the repositories. You can either wait until an npm update gets you v.3.4.7 or you can go manually download v.3.4.7 if you want to get going right away.

Dave Clark
  • 306
  • 1
  • 6
0

The problem has been resolved. I realized I am using node.js version 12.13.0, However New version 12.13.1 is already released. So I just updated my node js and my app is now working fine and not showing any issues.

Hammad Hassan
  • 606
  • 7
  • 20