简体   繁体   English

未处理的 JS 异常:未定义不是对象(正在评估“global.performance.now”)在 react-native-tvOS 中

[英]Unhandled JS Exception: undefined is not an object(evaluating 'global.performance.now') is in react-native-tvOS

I'm creating a React-Native-tvOs app and while running that default template app it shows this error.我正在创建一个 React-Native-tvOs 应用程序,并且在运行该默认模板应用程序时显示此错误。 I followed all the script from react-native-tvOs GitHub page but still, when I tried running it on the Xcode Apple TV simulator, it always throws this error.我遵循了 react-native-tvOs GitHub 页面中的所有脚本,但是,当我尝试在 Xcode Apple TV 模拟器上运行它时,它总是会抛出此错误。
This is the script I'm running is from GitHub react-native-tvOS page:-这是我正在运行的脚本来自 GitHub react-native-tvOS页面:-

npm install -g @react-native-community/cli
react-native init FinalPOC --template=react-native-tvos@latest
cd FinalPOC && react-native run-ios  --simulator "Apple TV" --scheme "FinalPOC-tvOS"

Screeshot of the Error:错误截图:
在此处输入图像描述

same error,同样的错误,

Modify this file react-native/Libraries/Utilities/createPerformanceLogger.js maybe work.修改这个文件react-native/Libraries/Utilities/createPerformanceLogger.js可能react-native/Libraries/Utilities/createPerformanceLogger.js

modify调整

export const getCurrentTimestamp: () => number =
 global.nativeQPLTimestamp ?? global.performance.now.bind(global.performance);

to

export const getCurrentTimestamp: () => number = Date.now

I got the same error,我得到了同样的错误,

  1. Remove node_modules with rm -rf rm -rf node_modules使用 rm -rf rm -rf node_modules

  2. Then do npm install然后执行npm install

    It works for me这个对我有用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 映射函数 - 未处理的 JS 异常:TypeError:undefined 不是评估映射的对象 - Map Function - Unhandled JS Exception: TypeError: undefined is not an object evaluating map 未处理的JS异常:TyperError:未定义不是对象(正在评估'_this.onPress.bind') - Unhandled JS Exception: TyperError: undefined is not an object (evaluating '_this.onPress.bind') React Native 组件异常:未定义不是 object(evalating_useContext.isAuthenticated - React Native Component Exception: undefined is not an object (evaluating_useContext.isAuthenticated React Native:未处理的promise promise:TypeError:undefined不是对象(评估'response.json') - React Native: Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'response.json') IOS - React Native - 未处理的JS异常:SyntaxError - IOS - React Native - Unhandled JS Exception: SyntaxError React native Undefined不是对象(评估'_react3.default.PropType.shape')吗? - React native Undefined is not an object(evaluating'_react3.default.PropType.shape')? React native Undefined不是对象(评估'_react3.default.PropType.shape') - React native Undefined is not an object(evaluating'_react3.default.PropType.shape') 反应本机。 未定义不是对象(评估“ this.props.navigator.push”) - React native. undefined is not object (evaluating 'this.props.navigator.push') React Native错误:undefined不是对象(评估'_this2.props.navigator.push') - React Native error: undefined is not an object (evaluating '_this2.props.navigator.push') React Native Redux:“未定义不是对象(正在评估'action.type')” - React Native Redux : “Undefined is not an object (evaluating 'action.type')”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM