0

After updating various packages with npm install --save <package-from-package.json>@latest, our UI-project in React can no longer be started (in developer mode in Visual Studio Professional 2017). The frontend error message is:

bootstrap:83 Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: Cannot read property 'bindings' of null
    at Scope.moveBindingTo (C:\myProject\node_modules\@babel\traverse\lib\scope\index.js:860:13)
    at BlockScoping.updateScopeInfo 

I did some research (on Stackoverflow), and the suggestion is to change stuff within .babelrc which was up to now empty, so I suppose that cannot be the thing to do. What does the error message tell me?

Background

Here an extract from package.json:

  "dependencies": {
    "@types/react-select": "*",
    "antd": "^3.23.2",
    "babel-polyfill": "6.23.0",
    "babel-preset-react": "^6.24.1",
    "download": "6.2.5",
    "draft-js": "^0.11.0",
    "immutable": "3.8.2",
    "jquery": "^3.4.1",
    "mini-css-extract-plugin": "^0.8.0",
    "moment": "^2.24.0",
    "react-lazy-load": "^3.0.13",
    "react-router": "^5.0.1",
    "react-router-dom": "^5.0.1",
    "redux": "3.6.0",
    "redux-saga": "^1.1.0",
    "reselect": "3.0.1",
    "whatwg-fetch": "^3.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.6.0",
    "@babel/node": "^7.6.1",
    "@babel/preset-env": "^7.6.0",
    "@babel/preset-react": "^7.0.0",
    "@types/node": "^12.7.5",
    "@types/react": "^16.9.2",
    "@types/react-dom": "0.14.23",
    "@types/react-redux": "4.4.40",
    "@types/react-router-dom": "^4.3.5",
    "@types/react-router-redux": "5.0.0",
    "ajv": "^6.10.2",
    "awesome-typescript-loader": "^5.2.1",
    "babel-core": "6.26.3",
    "babel-loader": "^8.0.6",
    "babel-plugin-transform-es2015-parameters": "6.24.1",
    "babel-preset-env": "1.7.0",
    "css-loader": "^3.2.0",
    "less": "2.7.3",
    "less-loader": "4.1.0",
    "react": "^16.9.0",
    "react-dom": "^16.9.0",
    "react-redux": "^7.1.1",
    "react-router-redux": "^4.0.8",
    "source-map-loader": "^0.2.4",
    "style-loader": "0.17.0",
    "ts-loader": "^6.1.0",
    "typescript": "^3.6.3",
    "webpack": "^4.40.2"
  }

References

B--rian
  • 5,578
  • 10
  • 38
  • 89
  • 1
    Removing some obsolete devDependencies might solve the problem. For example, `babel-preset-env` is archived and moved to main repository as `@babel/preset-env` which is exists in your package.json file. This may lead some conflictions. – alpakyol Sep 17 '19 at 13:27
  • 1
    https://babeljs.io/docs/en/v7-migration link may help if you upgrade babel from version 6 to 7. – alpakyol Sep 17 '19 at 13:30

0 Answers0