gpt4 book ai didi

node.js - 了解 Node ReferenceError转储

转载 作者:行者123 更新时间:2023-12-03 08:22:39 24 4
gpt4 key购买 nike

试图通过了解错误转储更好地了解如何进行调试。例如,我有如下引用错误:

ReferenceError: Can't find variable: title

This error is located at:
in TimerForm (at ToggleTimerForm.js:44)
in RCTView (at View.js:60)
in View (at ToggleTimerForm.js:42)
in ToggleableTimerForm (at App.js:54)
in RCTView (at View.js:60)
in View (at ScrollView.js:791)
in RCTScrollView (at ScrollView.js:887)
in ScrollView (at App.js:53)
in RCTView (at View.js:60)
in View (at App.js:47)
in App (at registerRootComponent.js:35)
in RootErrorBoundary (at registerRootComponent.js:34)
in ExpoRootComponent (at renderApplication.js:33)
in RCTView (at View.js:60)
in View (at AppContainer.js:102)
in RCTView (at View.js:60)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:32)

* components/TimerForm.js:54:6 in render
- node_modules/react-proxy/modules/createPrototypeProxy.js:44:35 in proxiedMethod
- node_modules/react-native/Libraries/Renderer/ReactNativeRenderer-dev.js:8811:23 in finishClassComponent
- ... 17 more stack frames from framework internals

本能地,我首先看到的是TimerForm,但是随后我看到ToggleTimerForm.js也被列出。 “在”是什么意思,“在”是什么意思?另外,为什么列出了这么多文件?它们在此错误转储中的意义是什么?

希望更好地了解所有工作原理!

最佳答案

基本上,这只是一个call stack,一个相互调用的函数链。通常,您希望查看最新的错误信息,但是通常您可能需要向上几个层次了解逻辑。

请注意,根据框架的不同,调用堆栈可能以不同的方式显示。在这种情况下,您看到的是react调用堆栈,而不是普通的node.js。

关于node.js - 了解 Node ReferenceError转储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52910262/

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