In my case I am using eslint on nextjs with eslint-config-next. I use bun as a package manager but I found instances of this issues on npm and yarn as well.
I didn't add any new package but after running bun update or yarn update the issues started appearing. Linting fails with the error:
Error while loading rule 'react/display-name': `[[GeneratorState]]` is not present on `O`
Occurred while linting ...
After some research, I found out similar issues reported on the
eslint-plugin-reactrepo and on its dependencies. This issue is related with errors in dependency resolution, when multiple incompatible versions of the same package are installed by the package manager. A similar issue was reported here. The solution is to remove duplicate dependencies:npm, the solution is to runnpm dedupeyarn, you can do the same by installing yarn-deduplicatepnpm, the solution is to runpnpm dedupebunthen you are in no luck because there is currently no dedupe command. In that case you should:bun install --yarnso you can inspect the dependenciesyarn.lockfilebun.lockbfrom the fixedyarn.lockWhat
npm dedupedoes, is simplifying dependencies by aggregating duplicated dependencies so they are shared across packages.