-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Description
Version
v22.10.0
Platform
Linux GuyuDebian 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Create following files:
package.json:
{
"private": true,
"type": "module"
}foo.js:
const bar = await import("./bar.js");
console.log(bar.default);bar.js:
import {} from "./foo.js";
export default "It works!";Then run node foo.js.
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior? Why is that the expected behavior?
Outputs It works!.
import {} from "./foo.js" doesn't import anything, and foo.js has already been linked, so it should not block the evaluation of bar.js.
What do you see instead?
Warning: Detected unsettled top-level await at file:///home/guyutongxue/Downloads/temp/web/foo.js:1
const bar = await import("./bar.js");
And the process exited with error code 13.
Additional information
Behavior of other runtime:
- Deno produces same result (error on unsettled TLA).
- Chromium: stuck on dynamic import.
- Firefox: also stuck on dynamic import.
- WinterJS: dynamic import promise rejected with internal error.
- Safari: outputs
It works!successfully. - Bun: outputs
It works!successfully.
I'm not sure what is the correct behavior that ECMAScript specification defines.
JoshuaKGoldberg, OlliV, elawad, buraksirma and LandonSchroppaantia, buraksirma and Gehbt
Metadata
Metadata
Assignees
Labels
No labels