Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Installation of Next.js app project #74313

Open
jolo00 opened this issue Dec 26, 2024 · 1 comment
Open

Docs: Installation of Next.js app project #74313

jolo00 opened this issue Dec 26, 2024 · 1 comment
Labels
Documentation Related to Next.js' official documentation.

Comments

@jolo00
Copy link

jolo00 commented Dec 26, 2024

What is the documentation issue?

Bug Report: ESLint Configuration Issues with Next.js and ESLint v9

Summary:
Following the Next.js documentation for ESLint setup leads to multiple configuration errors, particularly when using ESLint v9 and the new flat config format.

Issues Encountered:

  1. Initial setup following Next.js docs resulted in parsing errors with JSX
  2. Upgrading to ESLint v9 (as v8 is deprecated) caused additional issues
  3. Using flat config format led to "context.getAncestors is not a function" error
  4. The "@next/next/no-duplicate-head" rule fails to function properly

Solution Implementation:
The only working solution was to:

  1. Downgrade to ESLint v8.56.0
  2. Remove flat config implementation
  3. Use basic .eslintrc.json with only "extends": "next/core-web-vitals"

Suggested Improvements:

  1. Update Next.js documentation to address ESLint v9 compatibility
  2. Provide clear guidance on flat config vs traditional config usage
  3. Test and ensure compatibility with latest ESLint versions
  4. Update ESLint plugins to support newer versions

Is there any context that might help us understand?

Environment:

  • Next.js (latest)
  • Node.js (latest)
  • Initially attempted with ESLint v9
  • Finally working with ESLint v8.56.0

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/app/getting-started/installation

@jolo00 jolo00 added the Documentation Related to Next.js' official documentation. label Dec 26, 2024
@jolo00 jolo00 changed the title Docs: Installation of next app project Docs: Installation of Next.js app project Dec 26, 2024
@carlesandres
Copy link

I had the same problem and I have managed to fix this issue by installing @eslint/js and @eslint/eslintrc but for my life that I'm not able to find again the post where it was suggested 😄.

npm i @eslint/js @eslint/eslintrc -D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

No branches or pull requests

2 participants