【问题标题】:Getting the error message: "r is null" whenever running a Dash application运行 Dash 应用程序时收到错误消息:“r is null”
【发布时间】:2021-11-28 16:41:08
【问题描述】:

我找不到任何类似的问题。自从我开始开发 Dash 应用程序后,这个错误就出现了。

错误堆栈很长,而且。我不确定它是否提供信息,但我会添加它以防万一。

(This error originated from the built-in JavaScript code that runs Dash apps. Click to see the full stack trace or open your browser's console.)
value@http://127.0.0.1:8050/_dash-component-suites/dash/dcc/async-graph.js:1:7832
value@http://127.0.0.1:8050/_dash-component-suites/dash/dcc/async-graph.js:1:12619
callComponentWillReceiveProps@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:13111:16
updateClassInstance@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:13313:38
updateClassComponent@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:17242:22
beginWork@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:18755:18
callCallback@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:182:16
invokeGuardedCallbackDev@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:231:18
invokeGuardedCallback@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:286:33
beginWork$1@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:23338:30
performUnitOfWork@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:22292:14
workLoopSync@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:22265:24
performSyncWorkOnRoot@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:21891:11
flushSyncCallbackQueueImpl/<@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:11224:26
unstable_runWithPriority@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react@16.v2_0_0m1637923178.14.0.js:2685:14
runWithPriority$1@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:11174:12
flushSyncCallbackQueueImpl@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:11219:26
flushSyncCallbackQueue@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:11207:5
batchedUpdates$1@http://127.0.0.1:8050/_dash-component-suites/dash/deps/react-dom@16.v2_0_0m1637923178.14.0.js:21997:9
notify@webpack://dash_renderer/./node_modules/react-redux/es/utils/Subscription.js?:24:12
notifyNestedSubs@webpack://dash_renderer/./node_modules/react-redux/es/utils/Subscription.js?:95:20
handleChangeWrapper@webpack://dash_renderer/./node_modules/react-redux/es/utils/Subscription.js?:100:12
dispatch@webpack://dash_renderer/./node_modules/redux/es/redux.js?:307:7
createThunkMiddleware/</</<@webpack://dash_renderer/./node_modules/redux-thunk/es/index.js?:12:16
applyProps@webpack://dash_renderer/./src/observers/executedCallbacks.ts?:74:15
observer/</<@webpack://dash_renderer/./src/observers/executedCallbacks.ts?:115:40
forEach@webpack://dash_renderer/./node_modules/ramda/es/forEach.js?:50:7
_checkForMethod/<@webpack://dash_renderer/./node_modules/ramda/es/internal/_checkForMethod.js?:27:116
f2@webpack://dash_renderer/./node_modules/ramda/es/internal/_curry2.js?:34:14
observer/<@webpack://dash_renderer/./src/observers/executedCallbacks.ts?:102:55
forEach@webpack://dash_renderer/./node_modules/ramda/es/forEach.js?:50:7    
_checkForMethod/<@webpack://dash_renderer/./node_modules/ramda/es/internal/_checkForMethod.js?:27:116   
f2@webpack://dash_renderer/./node_modules/ramda/es/internal/_curry2.js?:34:14
observer@webpack://dash_renderer/./src/observers/executedCallbacks.ts?:84:51
StoreObserver/</<@webpack://dash_renderer/./src/StoreObserver.ts?:100:9
forEach@webpack://dash_renderer/./node_modules/ramda/es/forEach.js?:50:7
_checkForMethod/<@webpack://dash_renderer/./node_modules/ramda/es/internal/_checkForMethod.js?:27:116
f2@webpack://dash_renderer/./node_modules/ramda/es/internal/_curry2.js?:34:14
StoreObserver/<@webpack://dash_renderer/./src/StoreObserver.ts?:98:51
dispatch@webpack://dash_renderer/./node_modules/redux/es/redux.js?:307:7
createThunkMiddleware/</</<@webpack://dash_renderer/./node_modules/redux-thunk/es/index.js?:12:16
_callee$@webpack://dash_renderer/./src/observers/executingCallbacks.ts?:78:25
c@http://127.0.0.1:8050/_dash-component-suites/dash_bootstrap_components/_components/dash_bootstrap_components.v1_0_0m1637926595.min.js:14:4600
l/s._invoke</<@http://127.0.0.1:8050/_dash-component-suites/dash_bootstrap_components/_components/dash_bootstrap_components.v1_0_0m1637926595.min.js:14:4354
y/</<@http://127.0.0.1:8050/_dash-component-suites/dash_bootstrap_components/_components/dash_bootstrap_components.v1_0_0m1637926595.min.js:14:4963
asyncGeneratorStep@webpack://dash_renderer/./src/observers/executingCallbacks.ts?:13:103
_next@webpack://dash_renderer/./src/observers/executingCallbacks.ts?:15:212

很高兴收到您的意见和想法。

谢谢。

【问题讨论】:

    标签: python plotly-dash


    【解决方案1】:

    首先要检查的是PreventUpdate 在回调中用于处理空条件:

    def some_callback(some_input):
        if (some_input is None):
            raise PreventUpdate
    

    r is null 也发生在我的服务器端代码中出现错误时,导致 Dash 无任何显示。

    例如,当没有符合用户指定条件的跟踪时,我的服务器端代码会引发错误。在下面的屏幕截图中,您可以看到我为 y 轴设置了一个阈值0.98,并且没有任何痕迹满足该条件。这会触发错误,这意味着 Dash 没有要显示的组件。

    【讨论】:

    【解决方案2】:

    这个错误似乎是在开发 Dash 应用程序开始时发生的。一旦回调函数被调用,错误不再弹出。

    【讨论】:

      猜你喜欢
      • 2011-12-13
      • 2015-01-29
      • 2019-03-02
      • 2021-12-13
      • 2021-08-12
      • 1970-01-01
      • 2020-03-26
      • 1970-01-01
      • 2019-11-22
      相关资源
      最近更新 更多