The -c --extra-options-file flag isn't working
I was using the command with version 4.0.3, and it worked correctly.
npx peggy -c .\config.js
But now that I try to use it with version 4.1.1, I get the following error message:
Error importing config ".\config.js" 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:'
I'm not sure if this issue is directly related to Peggy or something in Node.
Node version: 22.5.1
OS: Windows 11
Try renaming it to .mjs to see if that works?
Also try ./ instead of .\, to help diagnose.
I'm still getting the same message
npx peggy -c .\config.mjs
Error importing config ".\config.mjs"
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:'
npx peggy -c ./config.mjs
Error importing config "./config.mjs"
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:'
npx peggy -c ./config.js
Error importing config "./config.js"
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:'
Nod. I'll look into this tomorrow.
Can you turn on "--verbose" command line flag, and post the results here? Be sure to mask out any personal information!
Sorry for taking so long to respond, I was a bit busy.
This is the output I receive:
npx --verbose peggy -c .\config.js
npm verbose cli C:\Program Files\nodejs\node.exe C:\Users\user\AppData\Roaming\nvm\v22.5.1\node_modules\npm\bin\npm-cli.js
npm info using [email protected]
npm info using [email protected]
npm verbose title npm exec peggy -c .\config.js
npm verbose argv "exec" "--loglevel" "verbose" "--" "peggy" "-c" ".\\config.js"
npm verbose logfile logs-max:10 dir:C:\Users\user\AppData\Local\npm-cache\_logs\2024-10-17T07_32_07_041Z-
npm verbose logfile C:\Users\user\AppData\Local\npm-cache\_logs\2024-10-17T07_32_07_041Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/peggy 392ms (cache revalidated)
Error importing config ".\config.js"
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:'
npm verbose cwd C:\Users\user\OneDrive\Documents\class12
npm verbose os Windows_NT 10.0.22631
npm verbose node v22.5.1
npm verbose npm v10.8.2
npm verbose exit 1
npm verbose code 1
npx peggy --verbose -c .\config.js
Error importing config ".\config.js"
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:'
@damianpeaf can you please try https://github.com/peggyjs/peggy/pull/569 to see if it works for you?
I had the same issue and #569 seems to be working well for me. Could we get this fix merged sometimes in the near future ?
@gzp79 thanks for testing. I'll get this merged and released in the next day or so.
In release v4.2.0