Skip to content

"Unxepcted identifier, expected the token ;" when using await inside of ES module #9102

Open
@DanielBaulig

Description

@DanielBaulig

When using await at the top level of an ES module flow flags that as an invalid use of await. I tried naming the file x.js as well as x.jsm and x.mjs and included an export statement to indicate that it's a ES module, without success. I searched the flow documentation for anything relating to module, es module and await, but didn't find anything relevant.

Flow version: v0.220.0

Expected behavior

Pass the type check.

According to MDN await is legal at the top level of a module.

Actual behavior

Error: Unexpected identifier, expected the token ;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions