React-native: undefined is not a function (evaluating '_iterator2[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()'

Created on 29 Aug 2018  路  21Comments  路  Source: facebook/react-native

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz
      Memory: 26.43 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.9.0 - /usr/local/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.2.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 27.0.3, 28.0.2
        API Levels: 23, 27, 28
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1 
      react-native: 0.56.0 => 0.56.0 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1

Description

I am just using firebase:5.4.1 and while importing firebase variable it is showing error undefined is not a function (evaluating '_iterator2[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()'

However it is working fine with iOS, issue is only with android. Here i am attaching screenshot of the error.

screenshot_1535540062

Reproducible Demo

I have just used import statement

import firebase from 'firebase'
Bug JavaScript Stale

Most helpful comment

I upgraded to 0.57.2 from 0.55.4 and the only thing that worked for me was to add babel-polyfill.

npm i --save-dev babel-polyfill

then in my index.js:

import 'babel-polyfill';

I did not try what @dungps suggested.

All 21 comments

https://github.com/facebook/react-native/issues/15902#issuecomment-373964965

I had faced this issue before and I found it.

@dungps Yes i have seen that comment, but here issue is i am not using any loop or anything related to iterator. I have just used firebase library and that also just import statement of firebase, nothing else.

@ravirupareliya I have the same issue here! Did you get a solution?

@bernacle Not yet with this version, i have downgraded it to 0.55.4

We are in the same page with this error.

Try this solution. It works for me

https://github.com/facebook/react-native/issues/15902#issuecomment-396963357

We are in the same page with this error.

I have the same issue here

@ravirupareliya @dungps @bernacle @RideShi @nsimmons I have same issue. did you find solution?

I upgraded to 0.57.2 from 0.55.4 and the only thing that worked for me was to add babel-polyfill.

npm i --save-dev babel-polyfill

then in my index.js:

import 'babel-polyfill';

I did not try what @dungps suggested.

I had the same issue while using firebase just add this to index.js
global.Symbol = require('core-js/es6/symbol');
require('core-js/fn/symbol/iterator');
require('core-js/fn/map');
require('core-js/fn/set');
require('core-js/fn/array/find');

I ran into the same problem when I want to for ... of the response headers of fetch on Android 4.4.4 and RN v0.57.4.
I use @babel/polyfill to solve the problem. It seems the fetch response.headers is not same as Headers

13450

@iamkaustubh1019 your solution worked for me!! Thanks.

@rahimrahman solution works for me, using react native 0.58.3 with firebase 5.8.2

@iamkaustubh1019 worked for me. thanks!!!

@lyson13 your welcome...

Guys, I don't know if this could help but for me was just a catch of a Promise not managed. Still don't get why, usually these errors come out as yellow boxes.

@rahimrahman please could you explain what was the issue and how polyfill was able to fix it. Thank you

Same issue too, who can explain this bug?

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlongster picture jlongster  路  3Comments

despairblue picture despairblue  路  3Comments

DreySkee picture DreySkee  路  3Comments

oney picture oney  路  3Comments

grabbou picture grabbou  路  3Comments