Hello,
I’ve been trying to use CesiumJS with Dash and followed the advice here. with a modification to run Cesium locally. That worked well until I introduced a call to dcc.Dropdown. I then get “Loading chunk 792 failed” as an error (see below).
ChunkLoadError: Loading chunk 792 failed.
(timeout: http://127.0.0.1:8053/_dash-component-suites/dash/dcc/async-dropdown.js)
at i.f.j (http://127.0.0.1:8053/_dash-component-suites/dash/dcc/dash_core_components.v2_11_0m1689793691.js:2:493077)
at http://127.0.0.1:8053/_dash-component-suites/dash/dcc/dash_core_components.v2_11_0m1689793691.js:2:490357
at Array.reduce (<anonymous>)
at i.e (http://127.0.0.1:8053/_dash-component-suites/dash/dcc/dash_core_components.v2_11_0m1689793691.js:2:490322)
at s (http://127.0.0.1:8053/_dash-component-suites/dash/dcc/dash_core_components.v2_11_0m1689793691.js:2:36274)
at initializeLazyComponentType (http://127.0.0.1:8053/_dash-component-suites/dash/deps/react-dom@16.v2_11_1m1689793691.14.0.js:1450:22)
at readLazyComponentType (http://127.0.0.1:8053/_dash-component-suites/dash/deps/react-dom@16.v2_11_1m1689793691.14.0.js:11997:5)
at mountLazyComponent (http://127.0.0.1:8053/_dash-component-suites/dash/deps/react-dom@16.v2_11_1m1689793691.14.0.js:17467:21)
at beginWork (http://127.0.0.1:8053/_dash-component-suites/dash/deps/react-dom@16.v2_11_1m1689793691.14.0.js:18737:18)
at beginWork$1 (http://127.0.0.1:8053/_dash-component-suites/dash/deps/react-dom@16.v2_11_1m1689793691.14.0.js:23314:16)
Python code:
import dash_bootstrap_components as dbc
import dash_cytoscape as cyto
from dash import Dash, Input, Output, dcc, html
app = Dash(
__name__,
title="DASH Test with Cesium",
suppress_callback_exceptions=True,
)
app.layout = html.Div(
dbc.Row(
[
dbc.Col(html.Div("Hello Cesium")),
dbc.Col(html.Div(dcc.Dropdown(["NYC", "MTL", "SF"], "NYC", id="demo-dropdown"))),
dbc.Col(html.Div(id="cesiumContainer")),
]
)
)
app.clientside_callback(
"""
function(id) {
window.viewer = new Cesium.Viewer(id,{
automaticallyTrackDataSourceClocks : false,
shouldAnimate: true,
imageryProvider : new Cesium.TileMapServiceImageryProvider({
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII'),
}),
baseLayerPicker : false,
geocoder : false
});
window.viewer.scene.globe.enableLighting = true;
return true;
}
""",
Output("cesiumContainer", "data-done"),
Input("cesiumContainer", "id"),
)
# Run the server.
if __name__ == "__main__":
app.run_server(debug=True, port=8053, use_reloader=False)
Any help/advice is appreaciated!