-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Error when: node v20, --test --loader
, await import
#47614
Comments
I've experienced the same problem in one my projects which uses Not sure if
test_runner
cc @nodejs/loaders, @nodejs/test_runner |
I suspect this is a duplicate of #47566. |
Can you please test now against latest |
@GeoffreyBooth I have tried the nightly, and it's still failing: https://github.com/iambumblehead/esmock/actions/runs/4804121738/jobs/8549299803?pr=199 |
It seems to be the same thing as nodejs/help#3902 (comment) |
--test --loader
, await import
I have performed some testing, and it seems like the real issue is the combination of @iambumblehead can you please compare your repro when running through vscode and through an external cli interface? |
see this repro for example: |
@MoLow politely, neither |
@nodejs/loaders I have checked the repro provided by @iambumblehead, and the root cause is see this repro // file.js
process.on('beforeExit', () => {
console.log('beforeExit')
})
import('./anyfile.js')
console.log('THIS CONSOLE LOG IS PREINTED') ./node file.js ✔
THIS CONSOLE LOG IS PREINTED
beforeExit ./node --experimental-loader="data:text/javascript,export default true" file.js ✔
(node:62415) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
THIS CONSOLE LOG IS PREINTED
beforeExit
beforeExit
beforeExit |
I have verified - this has been fixed via #47964 |
Version
v20.0.0
Platform
Darwin Bumbles-MBP.home 21.6.0 Darwin Kernel Version 21.6.0: Thu Mar 9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64 x86_64
What steps will reproduce the bug?
npm test
from the cloned or unpacked packageEssentially, using --loader and
await import('./path/to/module.js')
from inside any imported module causes the test to fail for no reason related to the test or any of the files used.A copy of the error seen in the test process is attached here
How often does it reproduce? Is there a required condition?
The issue is reproduced every time on this machine, using the package attached above
What is the expected behavior? Why is that the expected behavior?
The test in the attached package should pass without any error, following the behaviour of previous versions of node from v12 onward.
What do you see instead?
Error: Promise resolution is still pending but the event loop has already resolved
In the example failing test, the test process reaches the passing condition but the test fails regardless
The text was updated successfully, but these errors were encountered: