That results in an unhandled exception in the Node process, which results in Chromium not being stopped when running single-file as a subprocess from another app:
Only seems to happen with Node this time. In Deno it gives an unhandled error too, but the browser process is stopped for some reason. A workaround for Node would be to add global error handlers and close the browser there:
cdp-client.js
throws an error when a URL can not be reached: https://github.com/gildas-lormeau/single-file-cli/blob/2b1ddaeb5219dfd19d1a33507fd6d5a017e9ed75/lib/cdp-client.js#L188The error handler in
run
insingle-file-launcher.js
doesn't seem to be effective in this case because the error is thrown from a function that is registered as an event listener, which puts it outside of the scope of execution of single-file when the event listener is called: https://github.com/gildas-lormeau/single-file-cli/blob/2b1ddaeb5219dfd19d1a33507fd6d5a017e9ed75/lib/cdp-client.js#L170That results in an unhandled exception in the Node process, which results in Chromium not being stopped when running single-file as a subprocess from another app:
Only seems to happen with Node this time. In Deno it gives an unhandled error too, but the browser process is stopped for some reason. A workaround for Node would be to add global error handlers and close the browser there:
I'd also suggest to run
closeBrowser
from the error handler inrun
.