ESLint: Error while loading rule 'react/display-name': Cannot find module 'react'
See original GitHub issueI have a custom config file, which can be found here:
For some reason when I attempt to use this custom config in a project, I get the following error:
ESLint: Error while loading rule 'react/display-name': Cannot find module 'react' from 'C:\Users\Me\Websites' Occurred while linting C:\Users\Me\Websites\Templates\core\src\config\next\_app.tsx.
The plugin is installed at C:\Users\Me\Websites\Templates\core\node_modules\eslint-plugin-react
.
This only occurs for this plugin. I don’t have this issue with any other plugins I use. Everything appears to be setup correctly so I believe this is a bug with eslint-plugin-react.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
ESLint: Error while loading rule 'react/display-name ... - GitHub
ESLint : Error while loading rule 'react/display-name': Cannot find module 'react' from 'C:\Users\Me\Websites' Occurred while linting C:\Users\Me ...
Read more >Dealing with "Failed to load plugin 'react' declared in '.eslintrc'
Try to check your ESLint plugin Working directories given that you have a new one for your project with the create-react-app update.
Read more >Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >eslint-plugin-react - npm
Start using eslint-plugin-react in your project by running `npm i ... display-name, Disallow missing displayName in a React component ...
Read more >eslint/eslint - Gitter
js': Cannot find module 'eslint-plugin-react' This can happen for a couple of reasons: 1. The plugin name is spelled incorrectly in an ESLint...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Happens for me too. I’m on Linux.
This version works:
New versions are broken.
I’m having the same issue. It seems to be looking for the “react” module in the parent directory instead of the project root directory. Extremely frustrating