gpt4 book ai didi

javascript - 找不到变量 atob

转载 作者:行者123 更新时间:2023-12-03 17:42:47 24 4
gpt4 key购买 nike

Screen1.js

import React,{useEffect} from 'react'
import {View,Text} from 'react-native'
import * as firebase from 'firebase/app';
import '@firebase/firestore';

const Screen1 = props =>{

useEffect(() =>
{
var dbh = firebase.firestore().collection("Jots").doc("note");
dbh.set({name:"pradeep"}) //The yellow warning is popped up in this line.
});

return(
<View>
<Text>Title</Text>
</View>
)
}

安慰
[Unhandled promise rejection: ReferenceError: Can't find variable: atob]

Stack trace:
node_modules\@firebase\firestore\dist\index.cjs.js:23101:0 in <global>
http://192.168.0.108:19001/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&minify=false&hot=false:131203:60 in fromBase64String



我只是按照博览会文档中的指南进行操作,但仍然不知道为什么会出现此问题。对此需要一个明确的解释。还有什么是 atob 变量?

最佳答案

我曾尝试降级,但这并不是我的解决方案。我不知道为什么。

全局进口 base64 app.js 解决了这个问题。

import {decode, encode} from 'base-64'

if (!global.btoa) { global.btoa = encode }

if (!global.atob) { global.atob = decode }

感谢您的回复。

关于javascript - 找不到变量 atob,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60361519/

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