'Cannot read properties of null (reading 'version')
I got the error message below while trying to build my react application using yarn (yarn run build)
Failed to compile.
Error while loading rule 'react/display-name': Cannot read properties of null (reading 'version') Occurred while linting ///*//src/index.js
Here is my index.js file
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));
This my script snippet from package.json
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"prettier:fix": "prettier './src/**/*.js' --write",
"eslint:fix": "eslint ./src --fix",
"codeStyle:fix": "npm run prettier:fix && npm run eslint:fix",
"clear-all": "rimraf ./build ./node_modules"
}
Solution 1:[1]
I think you should delete your yarn.lock and install again and check that your project is installing and starting correctly then you can build your project, Your question is not clear and you should trace your project to found the missing parameter that cause error in your build process
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | N.SH |
