You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rebuild function is only provided when esbuild manages to finish a build. It would be nice if it could instead always return it (even on errors), so that we can decrease the feedback loop when fixing the build.
I tried doing it myself but although it almost works it crashes with the following right after it finishes the rebuild:
fatal error: all goroutines are asleep - deadlock!
goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc00010cd58)
runtime/sema.go:56 +0x45
sync.(*WaitGroup).Wait(0xc00010cd50)
sync/waitgroup.go:130 +0x65
main.runService(0x7ffeefbff401)
github.com/evanw/esbuild/cmd/esbuild/service.go:138 +0x636
main.main()
github.com/evanw/esbuild/cmd/esbuild/main.go:200 +0x3ae
goroutine 18 [chan receive]:
main.runService.func1(0xc00012e140, 0xc00010cd50)
github.com/evanw/esbuild/cmd/esbuild/service.go:66 +0x4a
created by main.runService
github.com/evanw/esbuild/cmd/esbuild/service.go:64 +0x1fc
goroutine 19 [chan receive]:
main.(*serviceType).sendRequest(0xc00012e140, 0x148ca60, 0xc066251980, 0x7, 0xc066278088)
github.com/evanw/esbuild/cmd/esbuild/service.go:163 +0x11e
main.runService.func2(0xc00012e140)
github.com/evanw/esbuild/cmd/esbuild/service.go:92 +0x47
created by main.runService
github.com/evanw/esbuild/cmd/esbuild/service.go:89 +0x6ae
The text was updated successfully, but these errors were encountered:
Yes, this is a known issue. One reason why I haven't done it yet is that it'll take a breaking API change to fix. I'm not totally sure what the best API design is. One approach is of course to have the API call never throw an error and instead return a result object with an error message in the array of logs. However, people will likely not check for it and then write brittle code that fails silently when an error happens. Incremental mode could work differently than non-incremental mode of course but the current consistency between the two is kind of nice. I definitely need to do something though.
Related: #1037 (about watch mode instead of incremental mode, but it's basically the same problem).
The
rebuild
function is only provided when esbuild manages to finish a build. It would be nice if it could instead always return it (even on errors), so that we can decrease the feedback loop when fixing the build.I tried doing it myself but although it almost works it crashes with the following right after it finishes the rebuild:
The text was updated successfully, but these errors were encountered: