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
{{ message }}
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
A third party library I use was failing to find the original sourcemaps of some transpiled JavaScripts, and I managed to map to problem to how resolveUrl translates file paths containing spaces (and perhaps other special chars too).
After going through resolveUrl() in resolve-url.js, a path like /dev/Test Folder/service.js.map will be translated to /dev/Test%20Folder/service.js.map, which in turn will make resolve() in source-map-resolve-node.js fail to locate the file, throwing an ENOENT: no such file or directory, open .... error.
This was tested on Windows. I don't know if the problem occurs on other platforms, but it probably does, because it seams fs.readFile (which is the read function passed to resolve() by the third party library) doesn't work with url encoded paths.
Now, I'm not sure if this is an oversight of the third party library (passing fs.readFile directly instead of a proxy to do some kind of path normalization), or if such normalization shouldn't be done directly by your library.
What do you think?
The text was updated successfully, but these errors were encountered:
Hello!
A third party library I use was failing to find the original sourcemaps of some transpiled JavaScripts, and I managed to map to problem to how
resolveUrl
translates file paths containing spaces (and perhaps other special chars too).After going through
resolveUrl()
inresolve-url.js
, a path like/dev/Test Folder/service.js.map
will be translated to/dev/Test%20Folder/service.js.map
, which in turn will makeresolve()
insource-map-resolve-node.js
fail to locate the file, throwing anENOENT: no such file or directory, open ....
error.This was tested on Windows. I don't know if the problem occurs on other platforms, but it probably does, because it seams
fs.readFile
(which is the read function passed toresolve()
by the third party library) doesn't work with url encoded paths.Now, I'm not sure if this is an oversight of the third party library (passing
fs.readFile
directly instead of a proxy to do some kind of path normalization), or if such normalization shouldn't be done directly by your library.What do you think?
The text was updated successfully, but these errors were encountered: