因此,出于某种原因,当我试图在我的手机上运行博览Go应用程序时,我就有了这个bug。如果我在网络浏览器上运行的话,显然是可以的。
这是错误日志
ReferenceError:找不到变量: TextDecoder
堆栈跟踪:
node_modules\expo\build\environment\react-native-logs.fx.js:27:4误差
node_modules\react-native\Libraries\Core\ExceptionsManager.js:95:4 in reportException
node_modules\react-native\Libraries\Core\ExceptionsManager.js:141:19 in handleException
node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
node_modules@react-native\polyfills\error-guard.js:49:36 in ErrorUtils.reportFatalError
node_modules\metro-runtime\src\polyfills\require.js:203:6 in guardedLoadModule
全球代码中的http://192.168.0.29:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:190345:3 .
发布于 2022-08-23 00:49:36
这也发生在我们身上,在一款应用程序上,它曾经在一个较老的世博会版本中工作过。我们的解决方案是将这一行添加到.babelrc.js文件中:
"presets": [
["babel-preset-expo", {
lazyImports: true, // <<< The fix
]
]发布于 2022-07-21 09:57:54
通过这样做,克服了这个问题;
npm install text-encoding
npm install big-integer
并将此代码粘贴在节点_模块>react本机>库>LogBox中。
const TextEncodingPolyfill = require('text-encoding');
const BigInt = require('big-integer')
Object.assign(global, {
TextEncoder: TextEncodingPolyfill.TextEncoder,
TextDecoder: TextEncodingPolyfill.TextDecoder,
BigInt: BigInt,
});https://stackoverflow.com/questions/72912840
复制相似问题