-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Consume source maps from JavaScript files #4499
Comments
Several issues referring to inline source maps were closed as duplicates of this one, but this also applies to linked source maps: function fail() {
throw new Error("failed");
}
fail(); Build with esbuild: $ esbuild repro.ts --minify --sourcemap=linked --outfile=repro.js With Node and $ node -r source-map-support/register repro.js
file:///repro.ts:2
throw new Error("failed");
^
Error: failed
at fail (file:///repro.ts:2:9)
at file:///repro.ts:5:1
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) With Deno: $ deno run repro.js
error: Uncaught Error: failed
"use strict";function fail(){throw new Error("failed")}fail();
^
at fail (file:///repro.js:1:36)
at file:///repro.js:1:56 |
I would love better source maps support. Useful for debugging unit tests. |
they would be really useful, currently |
This needs to be redesigned and implemented in The problem is that we have our own system of handling source maps and not using the built-in V8 APIs that Luca mentions here. We currently have a Arguably, we should remove that trait and instead move these methods to |
Current Deno will remap stack traces on files that have been compiled by Deno, as Deno caches both the original file and the emitted map, and loads those from the cache. When consuming JavaScript with source maps from other sources (like already compiled code) Deno does not handle the source map and ignore source map pragma included in files.
Deno should support both external source maps and inline source maps when fetching modules and store any source maps in the cache to be used when remapping stack traces.
This will have the side-effect of supporting the generation of source maps for bundles generated by
deno bundle
.One consideration is that source maps optionally can include the original sources. If they do, then when emitting an error, the original source line is available, but if they don't, we would not be able to log-out/resolve that original source line.
The text was updated successfully, but these errors were encountered: