-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
When running recover-source script, the tool throws an ENOENT: no such file or directory error while trying to write a file with a query string in the filename. The issue appears to be caused by an invalid file path due to a query parameter (?6e4c) being appended to the filename.
Error Log
...
...
Source code recovered to checkCircle.svg
Source code recovered to resend.svg
Source code recovered to index.tsx
node:fs:2426
return binding.writeFileUtf8(
^
Error: ENOENT: no such file or directory, open 'C:\Users\Myterious\Downloads\tmp\style.module.css?6e4c'
at Object.writeFileSync (node:fs:2426:20)
at C:\Users\Myterious\AppData\Roaming\npm\node_modules\recover-source\index.js:47:24
at SourceMapConsumer.with (C:\Users\Myterious\AppData\Roaming\npm\node_modules\recover-source\node_modules\source-map\lib\source-map-consumer.js:70:20)
at async handleFile (C:\Users\Myterious\AppData\Roaming\npm\node_modules\recover-source\index.js:33:5) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\Myterious\\Downloads\\tmp\\style.module.css?6e4c'
}
Node.js v22.14.0
Steps to Reproduce
-
Install recover-source globally:
`npm install -g recover-source` -
Run
recover-sourceon a.mapfile that contains query parameters in its source paths.
like for example in my case the .map file contains "webpack://myappwapi-web/./src/Components/Pages/stickyChat/CustomMessageItem/CustomContactItem.tsx/style.module.css?6e4c"
Environment
OS: Windows 11
Node.js version: v22.14.0
Possible Fix
- The tool should sanitize file paths before writing to disk.
- If query parameters exist in the filename, they should be stripped out.
Would appreciate any fix or workaround for this! π
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels