connorjs / css-typed

TypeScript declaration generator for CSS files
https://npmjs.com/package/css-typed
MIT License
4 stars 1 forks source link

Invalid file path error when providing `pattern` via `css-typed.config.js` on Windows #37

Open im-aIex opened 1 day ago

im-aIex commented 1 day ago

When not providing the pattern argument from the command line, and instead using the default css-typed.config.js

export default {
    pattern: "path/to/**/*.module.css",
};

it throws the following error:

node:internal/modules/esm/load:227 throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes); ^ 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 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:227:11) at defaultLoad (node:internal/modules/esm/load:109:3) at ModuleLoader.load (node:internal/modules/esm/loader:570:13) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:443:56) at new ModuleJob (node:internal/modules/esm/module_job:76:27) at #createModuleJob (node:internal/modules/esm/loader:456:17) at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:266:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:247:17) at async onImport.tracePromise.proto (node:internal/modules/esm/loader:482:25) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME' }

Workaround: pass the pattern via CLI

connorjs commented 1 day ago

Thank you for the issue! I will look at this and confirm I am using proper cross-platform libraries.


(Self-note) Look to add config test on Windows agent in GitHub actions build.