-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Open
Open
Copy link
Labels
Error HandlingRelated to handling errors (e.g., error.tsx, global-error.tsx).Related to handling errors (e.g., error.tsx, global-error.tsx).LintingRelated to `next lint` or ESLint with Next.js.Related to `next lint` or ESLint with Next.js.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.
Description
Link to the code that reproduces this issue
https://github.com/daikiejp/eslint-plugin-react-hooks
To Reproduce
- Just install a new fresh install of Next.js with pnpm
- Start editing
- Error from eslint:
Failed to load plugin 'react-hooks' declared in ' » eslint-config-next/core-web-vitals
Complete error:
eslint: -32603: Request textDocument/diagnostic failed with message: Failed to load plugin 'react-hooks' declared in ' » eslint-config-next/core-web-vitals » /Users/danny/dev/eslint-plugin-react-hooks/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/eslint-config-next/index.js': Cannot find module 'eslint-plugin-react-hooks'
Require stack:
- /Users/danny/dev/eslint-plugin-react-hooks/__placeholder__.js
Referenced from: /Users/danny/dev/eslint-plugin-react-hooks/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/eslint-config-next/index.js
This error is related to #73964
Current vs. Expected behavior
While the fix is simple (pnpm add -D eslint-plugin-react-hooks
), it would greatly Next.js should handle peer dependencies and install them in pnpm.
Provide environment information
Operative System:
Platform: darwin
Arch: arm64
Binaries:
Node: v23.11.0
Pnpm: 10.10.0
Relevant Packages:
next: 15.4.0-canary.19
eslint-config-next: 15.4.0-canary.19
Which area(s) are affected? (Select all that apply)
Error Handling, Linting
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
There's no documentation in eslint-config-next
about required peer plugins.
congthanh1910, Aralf, MangoMarcus, fab-uleuh, AlexanderSoliar and 14 more
Metadata
Metadata
Assignees
Labels
Error HandlingRelated to handling errors (e.g., error.tsx, global-error.tsx).Related to handling errors (e.g., error.tsx, global-error.tsx).LintingRelated to `next lint` or ESLint with Next.js.Related to `next lint` or ESLint with Next.js.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.