Skip to content

Babel 7 "useRuntimeModule" #65

@rkumorek

Description

@rkumorek

Hey,

I am running into an issue when I write for...of loop with await. (example). I am transpiling to ES5 with babel and I believe I need nodent-runtime to have that code running.
When I add useRuntimeModule: true to babel config I get this error:
[dev:build] Error: This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'.

I've tried adding @babel/helper-module-imports but couldn't make it work, not sure exactly how should I use it ;(
Is there a way I can make it work with fast-async and babel 7?

Edit:
What I just found out is it runs those async functions in the loop but anything that's after the loop not invoked. :/

....
// everything runs before
for (const hook of this.hooks.before) {
    await hook(); // this run
}
await asyncFunction(); // this doesn't run

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions