Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regeneratorRuntime is not defined #1

Open
afk-mario opened this issue Oct 19, 2017 · 1 comment
Open

regeneratorRuntime is not defined #1

afk-mario opened this issue Oct 19, 2017 · 1 comment

Comments

@afk-mario
Copy link

When I try to run the example project I get the following error:

[main.build.js?id=9121733:1]: ReferenceError: regeneratorRuntime is not defined

O fixed it installing the babel-polyfill and adding it to the main.js file

@zhouyu1993
Copy link

hello~

I first write .bablerc like this:

{
  "presets": [
    [
      "env",
      {
        "modules": false,
        "targets": {
          "browsers": [
            "> 1%",
            "last 3 versions",
            "ie >= 9",
            "ios >= 8",
            "android >= 4.2"
          ]
        },
        "useBuiltIns": "usage"
      }
    ],
    "stage-2"
  ]
}

And I don't add import 'babel-polyfill' in my entry file app.js.

It shows the error regeneratorRuntime is not defined.

So I add import 'babel-polyfill' in my entry file app.js. It works. But the file is big.

So I write .bablerc like this:

{
  "presets": [
    [
      "env",
      {
        "modules": false,
        "targets": {
          "browsers": [
            "> 1%",
            "last 3 versions",
            "ie >= 9",
            "ios >= 8",
            "android >= 4.2"
          ]
        },
        "useBuiltIns": false
      }
    ],
    "stage-2"
  ],
  "plugins": [
    "transform-runtime"
  ]
}

It don't need to add import 'babel-polyfill' in my entry file app.js. And the file is smaller.

I guess that the option useBuiltIns is something wrong.

TobiasWehrum added a commit to TobiasWehrum/babel-playcanvas-template that referenced this issue Mar 6, 2019
…uldn't get the alternative (and probably better) method described by zhouyu1993 to work with the Babel version used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants