Skip to content

Failed to load plugin 'react-hooks' declared in ' » eslint-config-next/core-web-vitals #78813

Open
@daikiejp

Description

@daikiejp

Link to the code that reproduces this issue

https://github.com/daikiejp/eslint-plugin-react-hooks

To Reproduce

  1. Just install a new fresh install of Next.js with pnpm
  2. Start editing
  3. 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/eslint-config-next@15.4.0-canary.19_eslint@9.26.0_jiti@2.4.2__typescript@5.8.3/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/eslint-config-next@15.4.0-canary.19_eslint@9.26.0_jiti@2.4.2__typescript@5.8.3/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error HandlingRelated to handling errors (e.g., error.tsx, global-error.tsx).LintingRelated to `next lint` or ESLint with Next.js.linear: nextConfirmed issue that is tracked by the Next.js team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions