-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
[BUG] Doesn't work when the config is outside of C:
drive on Windows
#47
Comments
here's what reports the Nuxt devtools terminal : > node D:/EDM115/Documents/IUT/SAE 3.A.01/Tab-Magiques/node_modules/@eslint/config-inspector/bin.mjs --no-open
ℹ Starting ESLint config inspector at http://127.0.0.1:8123
ℹ Reading ESLint config from D:\EDM115\Documents\IUT\SAE 3.A.01\Tab-Magiques\eslint.config.js
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_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 'd:'
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:403:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:56)
at new ModuleJob (node:internal/modules/esm/module_job:67:26)
at #createModuleJob (node:internal/modules/esm/loader:297:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:254:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:235:17)
at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:21) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
} |
This comment was marked as duplicate.
This comment was marked as duplicate.
It's likely a bug of https://github.com/egoist/bundle-require - if any one wants to help fixing it |
This comment was marked as duplicate.
This comment was marked as duplicate.
I don't think its related to what drive its on. Happens on any drive. Seems to be that withNuxt isn't getting imported correctly. |
To fix this temporarily you can use pathToFileURL to get the correct file path then import with that. For example, in Nuxt you can replace the contents of your eslint.config.mjs with the below; import { pathToFileURL } from 'url';
const fileURL = pathToFileURL('./.nuxt/eslint.config.mjs');
const withNuxt = await import(fileURL.href);
export default withNuxt.default({
// custom config
}) |
honestly I don't even know why the documentation recommends using it. it requires the app to be built (to generate the .nuxt folder) before even be able to start linting (see this action run, it's at this point that I understood that I would need to run
I get the idea, but I think a better thing would be to use another import : import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
export default createConfigForNuxt(
// config...
) I don't see the benefit of using |
@antfu Thank you for fixing this issue ❤ |
Description
When the project is located on another drive, here's the error :
Screenshot
Reproducible scenario
The text was updated successfully, but these errors were encountered: