Help debugging command that doesn't exit.
Is there a way to have Deno tell me what async tasks are still pending when a program ends?
I'm using a third-party API, and AFAICT
await
ing all the promises I can, but I still get to the end of my main()
and deno
doesn't exit.
So I've got:
Which gives me:
Any suggestions? I guess I'll fire up a debugger...2 Replies
Well, since
deno test --trace-ops
does what I want, I just wrapped my call in a test and ran it that way.
Looks like esbuild isn't cleaning up after itself:
There's an undocumented stop() method that you have to call to avoid this problem. 🤦
https://deno.land/x/esbuild@v0.17.12/mod.js?s=stop
This doesn't seem to be documented in the official API docs:
https://esbuild.github.io/api/