Skip to content

detect-module: Typeless module syntax detection does not report unsettled top-level await #54931

Closed

Description

@avivkeller

Version

v22.8.0

Platform

N/A

Subsystem

No response

What steps will reproduce the bug?

Create a repro.js file:

await new Promise(() => {});

Run repro.js

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

It should output the same as if the file was named repro.mjs:

Warning: Detected unsettled top-level await at file:///repro.mjs:1
await new Promise(() => {});
^

What do you see instead?

Silently exits.

Additional information

Ref: #54930

Activity

  1. added
    confirmed-bug
    loaders
    on Sep 13, 2024
  2. aduh95 commented on Sep 14, 2024

    @aduh95
    Contributor

    Silently exits.

    What's the exit code though?

  3. avivkeller commented on Sep 14, 2024

    @avivkeller
    MemberAuthor

    0:

    $ node repro.js && echo $? 
    (node:6296) [MODULE_TYPELESS_PACKAGE_JSON] Warning: file:///repro.js parsed as an ES module because module syntax was detected; to avoid the performance penalty of syntax detection, add "type": "module" to /package.json
    (Use `node --trace-warnings ...` to show where the warning was created)
    0
    
  4. added
    module
    esm
    on Nov 8, 2024
  5. changed the title [-]Typeless Module Detection does not report unsettled top-level await[/-] [+]detect-module: Typeless module syntax detection does not report unsettled top-level await[/+] on Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugesmloadersmodule

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions