-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
--enable-source-maps does not appear to show function names with webpack sourcemaps #35325
Comments
@michael-wolfenden I'm wondering if you have any recommendations on how we should display the original function name? The approach we've taken is to provide information about bot the call site with the error and the original call site, I'm wondering how we'd represent an alternate function name. |
@michael-wolfenden what do you think of this?
|
I would expect the output to look something like the output that
|
@michael-wolfenden we've opted to include both the call site where the error happened, and the original call site in our implementation of applying source maps to stack traces in Node.js. This is useful because sometimes you do want to look at the actual location where the error was thrown, i.e.,
☝️ especially when using a minifier there can be bugs that only crop up in the minified code, e.g., a collision on symbol names. I'd like to figure out a way to provide the original function name for you, without hiding the actual function name that executed. |
Based on advice from webpack project, this PR stops trying to resolve sources with a webpack:// scheme (or other schemes, as they represent absolute URLs). Source content is now loaded from the sourcesContent lookup, if it is populated (allowing for non file:// schemes). Refs: nodejs#35325
Ah gotcha ... In that case, your suggestion looks good 👍 |
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: #35325 PR-URL: #35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: #35325 PR-URL: #35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
If symbol names array has been populated in source map, include original symbol name in error message. Fixes nodejs#35325
If symbol names array has been populated in source map, include original symbol name in error message. Fixes nodejs#35325 PR-URL: nodejs#36042 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: nodejs#35325 PR-URL: nodejs#35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: nodejs#35325 Backport-PR-URL: nodejs#37717 PR-URL: nodejs#35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: nodejs#35325 Backport-PR-URL: nodejs#37717 PR-URL: nodejs#35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: nodejs#35325 Backport-PR-URL: nodejs#37717 PR-URL: nodejs#35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: nodejs#35325 PR-URL: nodejs#35903 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
We were incorrectly trying to run path.resolve on absolute sources URLs. This was breaking webpack:// URLs in stack trace output. Refs: #35325 PR-URL: #35903 Backport-PR-URL: #37717 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
What steps will reproduce the bug?
Here is a complete, minimal reproduction
https://github.com/michael-wolfenden/node-sourcemap-repro
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
I would expect to see the real function names in the output.
Using the
source-map-support
package, the stack trace looks like:What do you see instead?
Using the
--enable-source-maps
flag, the stack trace looks like:The text was updated successfully, but these errors were encountered: