Getting the error message: "r is null" whenever running a Dash application

Question:

I couldn’t find any similar issue. This error appears ever since I started developing a Dash application.

The error stack is very long and. I’m not sure it’s informative, but I’m adding it in case it is.

(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/[email protected]_0_0m1637923178.14.0.js:13111:16
updateClassInstance@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:13313:38
updateClassComponent@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:17242:22
beginWork@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:18755:18
callCallback@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:182:16
invokeGuardedCallbackDev@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:231:18
invokeGuardedCallback@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:286:33
beginWork$1@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:23338:30
performUnitOfWork@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:22292:14
workLoopSync@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:22265:24
performSyncWorkOnRoot@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:21891:11
flushSyncCallbackQueueImpl/<@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:11224:26
unstable_runWithPriority@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:2685:14
runWithPriority$1@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:11174:12
flushSyncCallbackQueueImpl@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:11219:26
flushSyncCallbackQueue@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_0_0m1637923178.14.0.js:11207:5
batchedUpdates$1@http://127.0.0.1:8050/_dash-component-suites/dash/deps/[email protected]_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

I’d be glad to get your opinions and ideas.

Thanks.

Asked By: Ziv

||

Answers:

It seems that this error occurs at the beginning of development of a Dash application. Once callback functions were called, the error no longer popped up.

Answered By: Ziv

The first thing to check is that PreventUpdate is being used in callbacks to handle null conditions:

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

The r is null also error occurs for me when errors are raised in my server-side code that leave Dash with nothing to display.

For example, my server-side code throws an error when there are no traces that meet the user-specified criteria. In the screenshot below, you can see that I set a threshold of 0.98 for the y-axis, and there are no traces satisfy that condition. This triggers the error, which means there is no component for Dash to display.

enter image description here

Answered By: Kermit

I programmed the Dash function to update my graphs which created another function in the script placed above the Dash app.
I accidentally forgot to return a fig once and then experienced this error, too.

Answered By: Mr.Slow
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.