Skip to content

babel-runtime: Cannot find module 'babel-runtime/helpers/asyncIterator' #4768

@petamoriken

Description

@petamoriken

Detail of #4671 (comment).

Input Code

const ai = (async function*(){})();

(async () => {
  for await (const val of ai) {}
})();

Babel Configuration (.babelrc, package.json, cli command)

{
    "presets":  [
        "latest",
        "stage-3"
    ],
    "plugins":  [
        "transform-runtime"
    ]
}

Current Behavior

babel input.js > output.js && node output.js returns below.

module.js:471
    throw err;
    ^

Error: Cannot find module 'babel-runtime/helpers/asyncIterator'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/Moriken/Sites/runtime-test/output.js:3:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Possible Solution

Store babel-runtime/helpers/asyncIterator.

Your Environment

software version
Babel 6.16.0
node 6.9.1
npm 3.10.8
Operating System macOS Sierra

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: duplicateoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions