Opening the ESLint Config Inspector fails with ERR_MODULE_NOT_FOUND
aaronz-vipaso opened this issue · 2 comments
aaronz-vipaso commented
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](https://private-user-images.githubusercontent.com/104493365/323911303-7742f59c-dd30-4e37-846a-dc53a2e64385.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQ5NDY5OTAsIm5iZiI6MTcxNDk0NjY5MCwicGF0aCI6Ii8xMDQ0OTMzNjUvMzIzOTExMzAzLTc3NDJmNTljLWRkMzAtNGUzNy04NDZhLWRjNTNhMmU2NDM4NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDUwNVQyMjA0NTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xNDE0NTlkYTgwMzgyNzhiOTkxZDYxOGNmZTYwYmYwYTkwNjJkNTBlZjVhNWM1ZjI2MTM4NzkzM2IzOTU4YmIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.gF2LcsUly8vyYtuP650VpUEglphzZaAkpGDu7BMdFLk)
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'
}
LittleTurtle2333 commented
Me, too
baixiaoyu2997 commented
same issue