nuxt/eslint

Opening the ESLint Config Inspector fails with ERR_MODULE_NOT_FOUND

aaronz-vipaso opened this issue · 2 comments

Environment

  • Operating System: Darwin
  • Node Version: v20.12.2
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: pnpm@9.0.1
  • Builder: -
  • User Config: devtools, modules
  • Runtime Modules: @nuxt/eslint@0.3.8
  • Build Modules: -

Package

@nuxt/eslint

Reproduction

  • Create new nuxt project
    pnpm dlx nuxi@latest init test
  • Add nuxt eslint
     npx nuxi module add eslint
  • Start dev server
    pnpm run dev
  • Open dev tools in the browser and try to open the eslint config inspector

Describe the bug

Opening the eslint config inspector shows an error:

ESlint config inspector error

Additional context

If I add the following dependencies manually and restart the dev server, opening the eslint config inspector works:

pnpm i -D pathe globals ohash json-schema-to-typescript-lite

Logs

> node /Users/myname/mypath/test/node_modules/.pnpm/@eslint+config-inspector@0.4.6_eslint@8.57.0/node_modules/@eslint/config-inspector/bin.mjs --no-open

ℹ Starting ESLint config inspector at http://127.0.0.1:8123 

ℹ Reading ESLint config from /Users/myname/mypath/test/eslint.config.mjs
Failed to load `eslint.config.js`.
Note that `@eslint/config-inspector` only works with the flat config format:
https://eslint.org/docs/latest/use/configure/configuration-files-new
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'pathe' imported from /Users/myname/mypath/test/eslint.config.bundled_oz3oqowithd.mjs
Did you mean to import "pathe/dist/index.cjs"?
    at packageResolve (node:internal/modules/esm/resolve:854:9)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

same issue