Bug description
When GLOBAL_ASYNC_QUERIES: True
is enabled, chart visualizations fail with JavaScript error "Cannot read properties of undefined (reading 'forEach')" while SQL Lab queries work correctly. This indicates a data format incompatibility between async query results and chart rendering.
superset_bug_report_async_queries.md
Screenshots/recordings
No response
Superset version
5.0.0
Python version
3.10
Node version
Not applicable
Browser
Chrome
Additional context
No response
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hi @krasmussen37! I'm Dosu and I’m helping the superset team.
This is a known issue in Superset 5.0.0 when GLOBAL_ASYNC_QUERIES is enabled: chart visualizations can fail with a JavaScript error due to a data format mismatch between the async query result and what the frontend expects. SQL Lab works because it uses a different data handling path that preserves the expected format.
The root cause is that the async chart data response may not include the expected structure (like the 'queries' or 'data' fields), which leads to frontend code trying to iterate over undefined values and throwing errors like "Cannot read properties of undefined (reading 'forEach')" see code details.
There's a related issue with more details and troubleshooting tips: using the same domain for both Superset and any embedded dashboards can resolve some async query issues. Sometimes, a manual dashboard refresh temporarily fixes the problem, suggesting a session or token context issue. There is currently no documented fix or workaround for this specific scenario see discussion.
If possible, consider temporarily disabling GLOBAL_ASYNC_QUERIES or ensuring domain consistency as a workaround. Keep an eye on the linked issue for updates.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other