question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint: Error while loading rule 'react/display-name': Cannot find module 'react'

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
sgehrmancommented, Jul 12, 2019

Happens for me too. I’m on Linux.

This version works:

"eslint-plugin-react": "7.11.1",

New versions are broken.

5reactions
davidysoardscommented, Jul 6, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found