Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined is not a function (evaluating '_iterator2[typeof Symbol === "function"

I am implementing firebase with react native, here are the versions i am working with

"firebase": "^5.4.1",
"react-native": "0.56.0",
"react": "16.4.1",

But when i import firebase, it is showing following error :

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

enter image description here

Note : Getting this error only on Android device, on iOS it is working perfect.

like image 850
Ravi Avatar asked Jul 14 '26 23:07

Ravi


1 Answers

I had the same issue when importing firebase and found the solution here

Add this in your index.js

// 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');

The way I see it is that there are certain JS syntaxes that doesn't translate well for android to understand.

like image 128
Syph Avatar answered Jul 17 '26 21:07

Syph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!