Plotly dash unexpected end of JSON input

The web app works as expected, but I get random errors.

Unexpected end of JSON input (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.) SyntaxError: Unexpected end of JSON input

at eval (webpack://dash_renderer/./src/actions/callbacks.ts?:330:18)

error.js:38 console.error(action.payload.error);

callbacks.ts:330 return res.json().then(function (data) {

What is the reason for this error?