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
Following up from #16531, for CommonJS modules we are now able to collect detailed coverage information regardless of how a process exits. This is facilitated by:
starting a process with --inspect-brk.
running startPreciseCoverage.
waiting for the event Runtime.executionContextDestroyed (this will fire when the isolate terminates execution).
ESM Failing
Using the same approach outlined above for .mjs files, the Runtime.executionContextDestroyed event does not appear to fire -- I see the following output in a hung terminal:
Debugger listening on ws://127.0.0.1:53080/ce9cf16c-dce4-42b1-bf4f-98b523c9f36e
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
(node:93632) ExperimentalWarning: The ESM module loader is experimental.
Waiting for the debugger to disconnect...
Reproducing this Issue
I've been keeping the module c8 up to date, as we march towards a native test coverage solution. To see the bug in action, clone the above repo and run:
And the application will exit as expected (c.mjs isn't using import syntax, it seems to simply be the new importer that conflicts with the Runtime.executionContextDestroyed event).
The text was updated successfully, but these errors were encountered:
addaleax
added
esm
Issues and PRs related to the ECMAScript Modules implementation.
inspector
Issues and PRs related to the V8 inspector protocol
labels
Nov 27, 2017
This bug isn't actually in the ESM loading system but in c8, since the .mjs file actually goes through the regular CJS loading process due to a lack of --experimental-modules. I've filed a PR that fixes this issue in c8 at bcoe/c8#6.
However, that PR doesn't make ESM just start working in c8 because of a separate bug in Node.js, which I've filed at #17340.
Background
Following up from #16531, for CommonJS modules we are now able to collect detailed coverage information regardless of how a process exits. This is facilitated by:
--inspect-brk
.startPreciseCoverage
.Runtime.executionContextDestroyed
(this will fire when the isolate terminates execution).ESM Failing
Using the same approach outlined above for
.mjs
files, theRuntime.executionContextDestroyed
event does not appear to fire -- I see the following output in a hung terminal:Reproducing this Issue
I've been keeping the module c8 up to date, as we march towards a native test coverage solution. To see the bug in action, clone the above repo and run:
./bin/c8.js --experimental-modules test/fixtures/c.mjs
note that you can run:
./bin/c8.js test/fixtures/c.mjs
And the application will exit as expected (c.mjs isn't using import syntax, it seems to simply be the new importer that conflicts with the
Runtime.executionContextDestroyed
event).CC: @bmeck, @ak239, @schuay, @hashseed
The text was updated successfully, but these errors were encountered: