-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript Exception - Uncaught (in promise) Error after upgrading dash to 2.7.1 #6444
Comments
Thanks @kevalshah90 - are you able to reduce this to a standalone app? I try to do that and it works with no error, but I had to comment out some of your missing variables from dash import Dash, dcc, html, Input, Output
import pandas as pd
MAPBOX_KEY = "<YOUR KEY>"
df = pd.DataFrame({
'x': [1, 2, 3],
'Lat': [37.774322, 37.777035, 37.773033],
'Long': [-122.489761, -122.485555, -122.491220]
})
app = Dash(__name__)
app.layout = html.Div([dcc.Graph(id="map"), dcc.Input(id="inp")])
@app.callback(Output('map','figure'), Input('inp','value'))
def fin(val):
data = [{
"type": "scattermapbox",
"lat": df["Lat"],
"lon": df["Long"],
"name": "Location",
"showlegend": False,
"hoverinfo": "text",
"mode": "markers",
"clickmode": "event+select",
# "customdata": df.loc[:,cd_cols].values,
"marker": {
"symbol": "circle",
"size": 8,
"opacity": 0.7,
"color": "black"
}
}]
layout = {
"autosize": True,
"hovermode": "closest",
"mapbox": {
"accesstoken": MAPBOX_KEY,
"bearing": 0,
# "center": {
# "lat": xxx,
# "lon": xxx
# },
# "pitch": 0,
# "zoom": zoom,
"style": "satellite-streets",
}
}
return ({'data': data, 'layout': layout})
if __name__ == '__main__':
app.run(debug=True) |
The observation in plotly/dash#2406 that this happens between Dash v2.6.1 and v2.7.1 narrows this down a bit - you could try adding a specific plotly.js version to your app, either by putting it in the Of course that's still not the same as reproducing it, what we really need is a standalone app that triggers the bug. Perhaps you can augment my app above with more details from your app until the bug appears? |
@alexcjohnson which specific version of I'll try to create shareable reproducible App, there are several dependencies, security credentials, env variables that make it tricky to create a minimal standalone App, but let me try. |
Right so I bet if you use the latest versions of dash and plotly.py but load plotly.js My guess is it'll be |
ooh the app @Coding-with-Adam posted in plotly/plotly.py#3631 (comment) shows the same JS error, and it's pretty simple. @archmoj is that enough to go off? |
ok, so the resolution for the time being is to go with |
Hi all,
My stack: More details on my problem is here: https://community.plotly.com/t/mapbox-custom-raster-tiles-not-updating/71962 |
How do you specify the plotly.js version in python? Having a similar problem with tiles and polygons not updating |
Reporting after trying with dash version 2.6.2 I have tried running the dashboard with dash 2.6.2 and my problem (scattermapbox not displaying new raster tiles following callback) seems reduced but not disappeared. WIth version 2.7.0 the problem (tiles not refreshing) and the Still haven't specified the plotly.js version (if this is even needed in a python dashboard).- If someone can provide indications for that I can try and report again EDIT: tried plotly (python) v 5.10. Problem appears to be worst EDIT2: I installed plotly version 5.9.0 which seems (according to the changelog) to run on plotly.js v 2.13.3 and unfortunately I still get the error:
so my latest stack is: and the problem is still there |
To replicate this issue on |
@archmoj It is not clear what changes you'd like me to make. Do you want to me to wrap my callback return statement in For reference, this what my return statement looks like:
|
@kevalshah90 Could you provide the minimal data and layout changes in the codepen that could trigger the bug when reacting between state 1 and state 2? |
I tried different plotly.js versions with the latest dash/plotly version. plotly==5.14.1 plotly.js (Strikethrough not working)
It looks like it works with the latest plotly.js version (2.22.0) |
My application renders a map and passes the
lat
,long
values from a pandas dataframe for plotly'sscattermapbox
graph object.I upgraded the
dash
andplotly
libraries to the latest version2.7.1
and5.13.0
. I am not able to render the points on the map. I do not see any errors in the application logs. The only exceptions I see are JS in console.The text was updated successfully, but these errors were encountered: