nuxt/eslint

Eslint fails on windows

richard-dp opened this issue · 2 comments

Environment

Nuxt project info: 14:54:24


  • Operating System: Windows_NT
  • Node Version: v20.11.1
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.5
  • Package Manager: npm@10.2.4
  • Builder: -
  • User Config: devtools, modules
  • Runtime Modules: @nuxt/eslint@0.3.0-beta.6
  • Build Modules: -

Package

@nuxt/eslint

Reproduction

https://github.com/richard-dp/nuxt-eslint-reproduction

Describe the bug

eslint fails to run on windows when @nuxt/eslint included

eslint will fail with the following error when attempting to import "./.nuxt/eslint.config.mjs":

ESLint: 8.57.0

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'e:'
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11)
    at defaultLoad (node:internal/modules/esm/load:130:3)
    at ModuleLoader.load (node:internal/modules/esm/loader:409:13)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:56)
    at new ModuleJob (node:internal/modules/esm/module_job:65:26)
    at #createModuleJob (node:internal/modules/esm/loader:303:17)
    at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:260:34)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:17)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:21)

Absolute path imports just need to be prefixed with "file://"

Additional context

No response

Logs

No response

I still get the error after this fix

needed to run yarn build in order for the eslint.config.mjs file to get recreated after update...