You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yet the clean method strips out the CWD from the file: URLs, leaving the file:// at the start, making them invalid.
This is a pressing issue, because the error stack from errors thrown in an ESM file starts with the file: URL of the ESM. The ecosystem is currently migrating to vanilla ESM (in .mjs files, or .js files with package "type": "module") and more people will start to notice this bug.
Then, run node test.mjs and the console log is ([CWD] substituting the absolute CWD path):
Error: Message.
at file://[CWD]/test.mjs:6:9
at ModuleJob.run (node:internal/modules/esm/module_job:175:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async Object.loadESM (node:internal/process/esm_loader:68:5)
file://test.mjs:6:9
Note the invalid file://test.mjs:6:9, it should be test.mjs:6:9.
Also, the cleaning needs to scan for file: URL paths with the CWD converted to the URL format, since a traditional file path and URL file path can differ in encoding of certain characters in the path string.
Activity
jaydenseric commentedon May 20, 2021
Also, the cleaning needs to scan for
file:URL paths with the CWD converted to the URL format, since a traditional file path and URL file path can differ in encoding of certain characters in the path string.conartist6 commentedon Oct 7, 2021
I'd help fix this.
conartist6 commentedon Nov 1, 2021
stack-tools can parse and print URIs now!
Return correct file path for mjs files.
Return correct file path for mjs files.
Return correct file path for mjs files.
Return correct file path for mjs files.
Return correct file path for mjs files.
mshima commentedon Dec 4, 2022
Workaround is to set a non existing cwd: