question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'babelHelpers.asyncToGenerator is not a function' error only on iOS

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

No

Environment

Environment: OS: macOS Sierra 10.12.1 Node: 7.9.0 Yarn: 0.20.3 npm: 4.2.0 Watchman: 4.9.0 Xcode: Xcode 8.3.3 Build version 8E3004b Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) react: 16.0.0-alpha.12 => 16.0.0-alpha.12 react-native: 0.48.3 => 0.48.3

Target Platform: iOS (10.3) Android

Expected Behavior

App to load as it does on android .

Actual Behavior

Error: babelHelpers.asyncToGenerator is not a function

iOS Simulator (10.3 @ iPhone 6)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
Lekocommented, Dec 9, 2017

I got same error in react-native 0.50.4. I think that babelHelpers.asyncToGenerator is missing in Libraries/polyfills/babelHelpers.js, right ?

It works fine after add babelHelpers.asyncToGenerator to Libraries/polyfills/babelHelpers.js. (It is partial of require('babel-core').buildExternalHelpers('asyncToGenerator'.split(' ')).)

babelHelpers.asyncToGenerator = function (fn) {
  return function () {
    var gen = fn.apply(this, arguments);
    return new Promise(function (resolve, reject) {
      function step(key, arg) {
        try {
          var info = gen[key](arg);
          var value = info.value;
        } catch (error) {
          reject(error);
          return;
        }

        if (info.done) {
          resolve(value);
        } else {
          return Promise.resolve(value).then(function (value) {
            step("next", value);
          }, function (err) {
            step("throw", err);
          });
        }
      }

      return step("next");
    });
  };
};

It is bug ? I made a mistake ?

0reactions
react-native-botcommented, Feb 24, 2018

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

Read more comments on GitHub >

github_iconTop Results From Across the Web

'babelHelpers.asyncToGenerator is not a function' error
App to load as it does on android. Actual Behavior. Error: babelHelpers.asyncToGenerator is not a function. iOS Simulator (10.3 @ iPhone 6) ...
Read more >
Babelhelpers.Asynctogenerator Is Not A Function' Error
I got a exception that babelHelpers.asyncToGenerator. export async function checkPermissionpermission { return await Any ideas how could I center align ...
Read more >
[Solved]-"babelHelpers.asyncToGenerator is not a function ...
Coding example for the question "babelHelpers.asyncToGenerator is not a function" on React-Native 0.16.0 and 0.17.0-node.js.
Read more >
fear48/react-native
Can I use await/async feature in react-native? I got a exception that babelHelpers.asyncToGenerator.
Read more >
Error: Cannot find module 'babel-runtime/helpers ...
I had the exact same error, it went away as soon as I moved the .env file outside the src/ folder. Not using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found