-
Notifications
You must be signed in to change notification settings - Fork 1.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
Inlining source content doesn't always include them. #2711
Comments
Also, just for clarity, this isn't a TypeScript-specific problem. Any dependency that is bundled with its own source map that omits the For example, the |
Ah, I see. I believe this is a request for esbuild to try to find the original source code on the file system and include it if it's present. That's not something that esbuild currently does but I think it makes sense for esbuild to do this. I'll look into it.
Yes, I think so. Consider a package with
A third option would be to put Right now esbuild does option 1 here, which seemed the most correct to me. |
Amazing, thank you @evanw! Totally makes sense about needing |
If a dependency is compiled with TypeScript and forgets to set
inlineSources: true
(which seems like the default?), then it will result in anull
entry in the source map'ssourcesContent
array.If you're bundling your output into a single file and serving that single file with its sourcemap inline (so that it's all contained in one place), then Chrome Devtools will fail when you try to step in to the source of that dependency with
Could not load content for …
because of thenull
value in the sources content array.I understand situations where you'd want to have all source content omitted with the
sourcesContent: false
option to save space. But whensourcesContent: true
is set, is there ever a case where you'd wantnull
entries? Wouldn't it be better if esbuild inlined the sources content itself if it was missing in the upstream package? (Or potentially as a separatebundleSources
setting?)I might be missing something since source maps are a little cryptic. If so I apologize.
But my use case was essentially hoping to bundle everything into a single file, with all source information included inline, so that no external requests are needed to provide full debugging abilities.
The text was updated successfully, but these errors were encountered: