-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: improve default source map behaviour for Node users #9601
Comments
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Bump |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Should this be reopened again @evilebottnawi? |
@evilebottnawi I did perform a search, specifically searching for the My hope is that someone from the project can provide some direction to the Node.js project, so that we can make sure our source-map handling works well for webpack. |
I like @OliverJAsh's recommendation that when When I look at the source maps generated by TypeScript:
and rollup:
Both opt to use relative paths in the
|
A SourceUrl like |
@sokra so, you'd advocate that when handling source maps for stack traces in Node.js, we do something like this:
☝️ if a URI of this format is observed. |
Yes |
Let's close in favor #3603, I think we can improve it for node users or as minimum improve docs how to chive it, it doesn't mean we don't work on it, it means we want to improve it and union issues because the issue related to |
Feature request
What is the expected behavior?
Given:
./package.json
(all latest versions):./webpack.config.js
:./src/index.js
(entry file):When running:
The error stack trace looks like this:
Observe how the path to the source file where the error originated is resolved against the source map, but only partially so. This makes it difficult to interact with the stack trace. E.g. in iTerm, it's usually possibly to Command + click a path to open it, but this is not possible here because the path is invalid. Ideally the original file path would be shown.
IIUC, we can fix this using
devtoolModuleFilenameTemplate
/moduleFilenameTemplate
:output: { path: TARGET_PATH, filename: OUTPUT_FILENAME, + devtoolModuleFilenameTemplate: "[absolute-resource-path]" }
Now the error stack trace looks like this:
However, I would like to suggest that we make this behaviour the default when using webpack to build code that will be ran by Node (i.e. when
target: 'node'
as in this example).Secondly, when using
eval-source-map
instead ofsource-map
(used above),devtoolModuleFilenameTemplate
does not help. The error stack trace always looks like this:Again, this path is difficult to interact with—ideally the original file path would be shown. What is the recommended fix in this case?
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: