gpt4 book ai didi

firebase - undefined 不是一个函数(正在评估 '_iterator2[typeof Symbol === "函数”

转载 作者:行者123 更新时间:2023-12-02 20:17:33 25 4
gpt4 key购买 nike

我正在使用 React Native 实现 Firebase,这是我正在使用的版本

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

但是当我导入 firebase 时,它​​显示以下错误:

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

enter image description here

注意:仅在 Android 设备上出现此错误,在 iOS 上它工作正常。

最佳答案

我在导入 firebase 时遇到了同样的问题并找到了解决方案 here

将其添加到您的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');

我的看法是,某些 JS 语法不能很好地翻译以供 Android 理解。

关于firebase - undefined 不是一个函数(正在评估 '_iterator2[typeof Symbol === "函数”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52075728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com