Skip to content

Version >= 3.8 causes ESLint stuck in nuxt project #356

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

Closed
ntnyq opened this issue Feb 17, 2025 · 17 comments
Closed

Version >= 3.8 causes ESLint stuck in nuxt project #356

ntnyq opened this issue Feb 17, 2025 · 17 comments

Comments

@ntnyq
Copy link

ntnyq commented Feb 17, 2025

Version

Since v3.8.0, v3.8.1 still have the issue.

v3.7.0 works as expected.

Reproduction repo

Steps

  • Run eslint --debug ., everything goes fine
  • Change USE_TYPESCRIPT_RESOLVER to true, and run eslint --debug . again.

ESLint will stuck at eslint:languages:js Scope analysis successful message

@ntnyq
Copy link
Author

ntnyq commented Feb 17, 2025

Only happened in my NuxtJS project.

For other projects, it still works fine.

@ntnyq
Copy link
Author

ntnyq commented Feb 17, 2025

Maybe there are too much node_modules path in nuxt generated tsconfig.json file.

{
  "compilerOptions": {
    "paths": {
      "nitropack/types": [
        "../node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack/types"
      ],
      "nitropack/runtime": [
        "../node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack/runtime"
      ],
      "nitropack": [
        "../node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack"
      ],
      "defu": [
        "../node_modules/.pnpm/[email protected]/node_modules/defu"
      ],
      "h3": [
        "../node_modules/.pnpm/[email protected]/node_modules/h3"
      ],
      "consola": [
        "../node_modules/.pnpm/[email protected]/node_modules/consola"
      ],
      "ofetch": [
        "../node_modules/.pnpm/[email protected]/node_modules/ofetch"
      ],
      "@unhead/vue": [
        "../node_modules/.pnpm/@[email protected][email protected][email protected]_/node_modules/@unhead/vue"
      ],
      "@nuxt/devtools": [
        "../node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected][email protected]_9ee0250e209ac58c719ffd43dfe4102d/node_modules/@nuxt/devtools"
      ],
      "@vue/runtime-core": [
        "../node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core"
      ],
      "@vue/compiler-sfc": [
        "../node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-sfc"
      ],
      "unplugin-vue-router/client": [
        "../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected][email protected]_/node_modules/unplugin-vue-router/client"
      ],
      "@nuxt/schema": [
        "../node_modules/.pnpm/@[email protected]/node_modules/@nuxt/schema"
      ],
      "nuxt": [
        "../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._255c37df78b381005c9aaa0ce6468c22/node_modules/nuxt"
      ],
      "vite/client": [
        "../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/client"
      ],
      "~": [
        ".."
      ],
      "~/*": [
        "../*"
      ],
      "@": [
        ".."
      ],
      "@/*": [
        "../*"
      ],
      "~~": [
        ".."
      ],
      "~~/*": [
        "../*"
      ],
      "@@": [
        ".."
      ],
      "@@/*": [
        "../*"
      ],
      "#shared": [
        "../shared"
      ],
      "assets": [
        "../assets"
      ],
      "public": [
        "../public"
      ],
      "#app": [
        "../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._255c37df78b381005c9aaa0ce6468c22/node_modules/nuxt/dist/app"
      ],
      "#app/*": [
        "../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._255c37df78b381005c9aaa0ce6468c22/node_modules/nuxt/dist/app/*"
      ],
      "vue-demi": [
        "../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._255c37df78b381005c9aaa0ce6468c22/node_modules/nuxt/dist/app/compat/vue-demi"
      ],
      "#vue-router": [
        "../node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-router"
      ],
      "#imports": [
        "./imports"
      ],
      "#app-manifest": [
        "./manifest/meta/cc5befc9-0c27-4f58-9757-ace23830319b"
      ],
      "#components": [
        "./components"
      ],
      "#build": [
        "."
      ],
      "#build/*": [
        "./*"
      ]
    },
    "esModuleInterop": true,
    "skipLibCheck": true,
    "target": "ESNext",
    "allowJs": true,
    "resolveJsonModule": true,
    "moduleDetection": "force",
    "isolatedModules": true,
    "verbatimModuleSyntax": true,
    "strict": true,
    "noUncheckedIndexedAccess": false,
    "forceConsistentCasingInFileNames": true,
    "noImplicitOverride": true,
    "module": "preserve",
    "noEmit": true,
    "lib": [
      "ESNext",
      "dom",
      "dom.iterable",
      "webworker"
    ],
    "jsx": "preserve",
    "jsxImportSource": "vue",
    "types": [],
    "moduleResolution": "Bundler",
    "useDefineForClassFields": true,
    "noImplicitThis": true,
    "allowSyntheticDefaultImports": true
  },
  "include": [
    "./nuxt.d.ts",
    "../.config/nuxt.*",
    "../**/*",
    "../node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected][email protected]_9ee0250e209ac58c719ffd43dfe4102d/node_modules/@nuxt/devtools/runtime",
    "../node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected][email protected]_9ee0250e209ac58c719ffd43dfe4102d/node_modules/@nuxt/devtools/dist/runtime",
    "../node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/telemetry/runtime",
    "../node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/telemetry/dist/runtime",
    ".."
  ],
  "exclude": [
    "../dist",
    "../node_modules",
    "../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._255c37df78b381005c9aaa0ce6468c22/node_modules/nuxt/node_modules",
    "../node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected][email protected]_9ee0250e209ac58c719ffd43dfe4102d/node_modules/@nuxt/devtools/node_modules",
    "../node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/telemetry/node_modules",
    "../node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected][email protected]_9ee0250e209ac58c719ffd43dfe4102d/node_modules/@nuxt/devtools/runtime/server",
    "../node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected][email protected][email protected]_9ee0250e209ac58c719ffd43dfe4102d/node_modules/@nuxt/devtools/dist/runtime/server",
    "../node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/telemetry/runtime/server",
    "../node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/telemetry/dist/runtime/server",
    "../.output"
  ]
}

@JounQin
Copy link
Collaborator

JounQin commented Feb 18, 2025

cc @carlocorradini

@mkosir
Copy link

mkosir commented Feb 18, 2025

I’m experiencing the same issue with the project react-parallax-tilt.
You can reproduce it by upgrading the dependency version to >=3.8

@carlocorradini
Copy link
Contributor

@mkosir @ntnyq I'll try to fix it ASAP

@carlocorradini
Copy link
Contributor

I've tried your repo on Windows with import-x/resolver-next forced to use createTypeScriptImportResolver.
Executed the command npx eslint --debug . and everything worked fine, I obtained the following correct output (added debug.enable(IMPORTER_NAME); in eslint-import-resolver-typescript source code):

eslint-import-resolver-typescript looking for typescript-eslint in [OMITTED]\eslint-import-resolver-typescript-main\eslint.config.mjs +0ms
eslint-import-resolver-typescript matched node path: [OMITTED]\eslint-import-resolver-typescript-main\node_modules\typescript-eslint\dist\index.d.ts +26ms
eslint-import-resolver-typescript looking for eslint-plugin-import-x in [OMITTED]\eslint-import-resolver-typescript-main\eslint.config.mjs +0ms
eslint-import-resolver-typescript looking for @types\eslint-plugin-import-x in [OMITTED]\eslint-import-resolver-typescript-main\eslint.config.mjs +10ms
eslint-import-resolver-typescript didn't find  @types\eslint-plugin-import-x +10ms
eslint-import-resolver-typescript matched node path: [OMITTED]\eslint-import-resolver-typescript-main\node_modules\eslint-plugin-import-x\lib\index.js +0ms
eslint-import-resolver-typescript looking for eslint-import-resolver-typescript in [OMITTED]\eslint-import-resolver-typescript-main\eslint.config.mjs +1ms
eslint-import-resolver-typescript matched node path: [OMITTED]\eslint-import-resolver-typescript-main\node_modules\eslint-import-resolver-typescript\lib\index.d.ts +6ms

Nothing blocked ESLint, any ideas?

@tbastyns
Copy link

We've had a similar issue where a small module that previously took 2-3 seconds to lint, suddenly started taking 30-40 seconds
We developers both use macs and suffer from this slowness. Our CI/CD pipeline, which runs on ubuntu, was not affected

At first glance, the issue looks to be resolved after bumping tinyglobby (dependency of this package) from 0.2.10 to 0.2.11 (either by messing with our lockfile, or adding it explicitly as a dependency)

If you look at the changelog of tinyglobby, they do indeed mention something about performance: https://github.com/SuperchupuDev/tinyglobby/releases/tag/0.2.11 , so it seems like a reasonable explanation. Bumping the dependency here could maybe solve the issue for other people as well :)

@ntnyq
Copy link
Author

ntnyq commented Feb 18, 2025

I've made a new commit to the reproduction repo.

Enabled typescript resolver add added a workflow to run lint in different os.

ESLint stuck at every os with lts/latest node add the workflow failed after 10min(timeout is set to 10min).

You can check it here

https://github.com/ntnyq-dev/eslint-import-resolver-typescript/actions/runs/13391158732

@carlocorradini
Copy link
Contributor

@tbastyns See PR #357

@carlocorradini
Copy link
Contributor

@ntnyq I'll retry, give me a couple of minutes... stay tuned

@carlocorradini
Copy link
Contributor

I tried using npm and it worked. The problem occurs when using pnpm.
I'll look into it further, but does anyone have any ideas about what's causing it?

@tbastyns
Copy link

a possibility would be that if you do a fresh install on the provided reproduction-repo, it will now install [email protected] (as it satisfies ^2.0.10), but when using pnpm it will take into account pnpm-lock.yaml, where the version is 'pinned' to 0.2.10

or maybe tinyglobby has nothing to do with the original issue of this thread :D it's just a guess

@ntnyq
Copy link
Author

ntnyq commented Feb 18, 2025

Bump tinyglobby to v0.2.11 does solve the issue.

I tried in my local by adding

 "resolutions": {
    "tinyglobby": "^0.2.11"
  }

@carlocorradini
Copy link
Contributor

PR #357 should fix the issue then 🥳
Nevertheless, I'll try with npm and tinyglobby 0.2.10

@carlocorradini
Copy link
Contributor

I can guarantee that this problem happens in npm while using tinyglobby version 0.2.10, but not version 0.2.11.
Therefore, when PR #357 is merged the issue is fixed

@carlocorradini
Copy link
Contributor

@SukkaW This can be closed 🥳

@SukkaW
Copy link
Collaborator

SukkaW commented Feb 18, 2025

Fixed by #357 (hopefully) and included in v3.8.2.

@SukkaW SukkaW closed this as completed Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants