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

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'

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 21

Most upvoted comments

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’);

@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.