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
Sourcemaps work, but location mapping is one off in terms of traversing up the filesystem hierarchy. I looked into the code and it seems despite ncc programmatically supporting sourceMapBasePrefix, it is not computed at all, let alone relatively to the --output. when I add on extra, sourcemap locations start to match to the original files and I can click on the stack trace and get to an error directly from my vs code
before fix (notice how dist is still included into the filepath):
~/projects/nordnet/gitops (fix/multi-document-yaml) $ node --env-file=.env.test dist/pr/index.js
file:///Users/vlasta/projects/nordnet/gitops/dist/src/utils/enhanced-core.js:7
.foo()
^
TypeError: str.foo is not a function
at getListFromString (file:///Users/vlasta/projects/nordnet/gitops/dist/src/utils/enhanced-core.js:7:1)
at Object.getListInput (file:///Users/vlasta/projects/nordnet/gitops/dist/src/utils/enhanced-core.js:26:1)
at run (file:///Users/vlasta/projects/nordnet/gitops/dist/pr/action.js:35:1)
after fix:
~/projects/nordnet/gitops (fix/multi-document-yaml) $ node --env-file=.env.test dist/pr/index.js
file:///Users/vlasta/projects/nordnet/gitops/src/utils/enhanced-core.js:7
.foo()
^
TypeError: str.foo is not a function
at getListFromString (file:///Users/vlasta/projects/nordnet/gitops/src/utils/enhanced-core.js:7:1)
at Object.getListInput (file:///Users/vlasta/projects/nordnet/gitops/src/utils/enhanced-core.js:26:1)
at run (file:///Users/vlasta/projects/nordnet/gitops/pr/action.js:35:1)
The text was updated successfully, but these errors were encountered:
iamstarkov
changed the title
sourcemap filesystem mapping is broken when output is more than one folder deep
static sourcemap base prefix of ../ leads to incorrect filepaths in source mapped stack traces, when output folder is more than one folder deep
Feb 16, 2025
I believe if you if sourcemapbaseprefix to be relative from build file to output folder, it will solve the issue, so I raised #1254 to discuss that potential fix
in my case I have a GitHub action which can consists of smaller sub actions which can be used by themselves. Think of
actions/cache
with itsactions/cache/save
andactions/cache/restore
. cache action builds into single dist folder but have multiple sub folders for every sub action. I do the same.Sourcemaps work, but location mapping is one off in terms of traversing up the filesystem hierarchy. I looked into the code and it seems despite ncc programmatically supporting
sourceMapBasePrefix
, it is not computed at all, let alone relatively to the--output
. when I add on extra, sourcemap locations start to match to the original files and I can click on the stack trace and get to an error directly from my vs codebuild of the
pr
sub action:before fix (notice how dist is still included into the filepath):
after fix:
The text was updated successfully, but these errors were encountered: