-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
OOM when sourcemaps are enabled for data url loader #304
Comments
I ended up looking at a goroutine trace and seeing that things were getting stuck at --- a/github.com/evanw/esbuild/internal/printer/printer.go
+++ b/github.com/evanw/esbuild/internal/printer/printer.go
@@ -2855,6 +2861,13 @@ func quotedSources(tree *ast.AST, options *PrintOptions) []QuotedSource {
return results
}
+ if strings.HasSuffix(options.SourceForSourceMap.PrettyPath, ".svg") ||
+ strings.HasSuffix(options.SourceForSourceMap.PrettyPath, ".jpg") ||
+ strings.HasSuffix(options.SourceForSourceMap.PrettyPath, ".png") ||
+ strings.HasSuffix(options.SourceForSourceMap.PrettyPath, ".gif") {
+ return nil
+ } How should these sources get opted-out of the sourcemap? Separately, I think my deterministic failure is unrelated to this directly because I sometimes see it even with this fix, and in that scenario it doesn't even seem to get past the scan phase and into compile. |
Thanks for pointing out the issue with the Any chance your issue is fixed in the latest release? If not, is there any change in behavior? Does it still get stuck in the scan phase? Also, since you're running on the plugins branch, are you using any plugins? Does this problem still happen with the publicly-released version? |
Thanks for taking a look! I applied just 1e33ddb and it looks like it fixes my problem. I also tried to upgrade to 0.6.13, but I'm also running into the panic from #311.
I'm using plugins but the problem persists when I make them do nothing (just returning |
Hi,
I'm trying to get a relatively large (5k+ files) js/ts application previously using webpack to bundle and run with esbuild. I'm running the plugins branch at 139ae87
When I run esbuild without sourcemaps, things work great. The build takes ~2s and loads without problems. When I make the change to build sourcemaps, I see some non-deterministic behavior. One of two things happens:
My machine has 64GB of memory. For more context, the output bundle from esbuild (in the non-sourcemaps case) is about ~30MB.
I grabbed a heap pprof here in case it helps: https://gist.githubusercontent.com/stephen/b187eb463e75cc342b5da94da68c0797/raw/c871fccb9673f676eb6cd1ed8284ebd1c7a172c6/heap.svg
Occasionally, I see the bundler complete in 3-4s with a big list of errors:Update: this seems unrelatedIn this case, there aren't any other errors other than these
Could not read from file
. It seems like all errors from from thenode_modules/react-data-grid/node_modules/@material-ui
tree. I can confirm that these do exist:Unfortunately, I can't share the codebase to show a repro, but I've been reading the source a bit and I'm happy to poke around more. My esbuild options look like this:
Do you have other suggestions for where to look in the esbuild code for what might be going wrong?
The text was updated successfully, but these errors were encountered: