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

Updating eslint to 9 causes dev server errors. #39033

Open
2 tasks done
JustFly1984 opened this issue Jul 3, 2024 · 4 comments
Open
2 tasks done

Updating eslint to 9 causes dev server errors. #39033

JustFly1984 opened this issue Jul 3, 2024 · 4 comments
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@JustFly1984
Copy link

Preliminary Checks

Description

I've tried to update eslint to 9, with new flat config.VSCode and cli works good, but then I'm trying to run dev, it fails with error.
Looking at documentation, disabling eslint with empty .eslintrc doesn't help.

Error:

 ERROR #98123  WEBPACK.DEVELOP

Generating development JavaScript bundle failed

Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

failed Building development bundle - 3.210s
ERROR in Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

develop compiled with 1 error

Reproduction Link

don't have a repro

Steps to Reproduce

  1. Update eslint and plugins to latest
  2. Run migration eslintrc to mjs https://eslint.org/docs/latest/use/configure/migration-guide
  3. Run eslint in cli, to check if config is correct.
  4. Run gatsby develop - you will get an error

Expected Result

Dev server should be decoupled from eslint version.
Gatsby should support eslint@9 and flat config.

Actual Result

Error:

 ERROR #98123  WEBPACK.DEVELOP

Generating development JavaScript bundle failed

Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

failed Building development bundle - 3.210s
ERROR in Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

develop compiled with 1 error

Environment

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Shell: 3.2.57 - /bin/sh
  Binaries:
    Node: 22.4.0 - /tmp/yarn--1720005845909-0.247377011876049/node
    Yarn: 1.22.22 - /tmp/yarn--1720005845909-0.247377011876049/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v22.4.0/bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5
  npmPackages:
    gatsby: 5.13.6 => 5.13.6
    gatsby-link: 5.13.1 => 5.13.1
    gatsby-plugin-catch-links: 5.13.1 => 5.13.1
    gatsby-plugin-dts-css-modules: 3.0.0 => 3.0.0
    gatsby-plugin-minify-classnames: 5.0.0 => 5.0.0
    gatsby-plugin-postcss: 6.13.1 => 6.13.1
    gatsby-plugin-purgecss: 6.2.1 => 6.2.1
    gatsby-plugin-root-import: 2.0.9 => 2.0.9
    gatsby-plugin-sass: 6.13.1 => 6.13.1
    gatsby-plugin-sitemap: 6.13.1 => 6.13.1
    gatsby-plugin-typescript: 5.13.1 => 5.13.1
    gatsby-react-router-scroll: 6.13.1 => 6.13.1
    gatsby-script: 2.13.0 => 2.13.0

Config Flags

No response

@JustFly1984 JustFly1984 added the type: bug An issue or pull request relating to a bug in Gatsby label Jul 3, 2024
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 3, 2024
@Austaras
Copy link
Contributor

Austaras commented Aug 5, 2024

As a workaround, you can create a empty .eslintrc to disable eslint-loader. A proper fix is possible, but with the current status of gatsby, it would take some time.

@JustFly1984
Copy link
Author

I've tried the workaround, gatsby still crashes

@justinchan23
Copy link

i resolved this issue by the following:

  1. npm install --save-dev gatsby-plugin-eslint eslint eslint-webpack-plugin eslint-config-react-app
  2. create an empty .eslintrc.js file in the root dir

linting still works using the cli but may not appear in the running gatsby process .

alternatively if the above doesnt fix your dev server you can just build and serve the app (not ideal but was a workaround for me)

@amalitsky
Copy link
Contributor

Could not figure this one out. Already had .eslintrc.js in place.
Rolled eslint back to v.8.57.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

4 participants