Fix uncaught ApexCharts error on dashboard load (#249)#250
Open
misterbh-saashup wants to merge 2 commits into
Open
Fix uncaught ApexCharts error on dashboard load (#249)#250misterbh-saashup wants to merge 2 commits into
misterbh-saashup wants to merge 2 commits into
Conversation
added 2 commits
June 2, 2026 20:47
The system-usage donut built its series straight from /system/usage, but that endpoint omits some keys depending on daemon state — e.g. `layers_size` is absent on an empty daemon — so the first series value was `undefined`. ApexCharts cannot render an undefined data point and threw "Cannot read properties of undefined (reading 'type')" from inside create(), an uncaught error on every page load (the chart happened to still render). Coerce every series value to a finite number (missing -> 0) so the series is always valid. Verified: an automated 25-load check went from 25/25 erroring to 0/25, and the chart still renders. Fixes #249
Remove the tolerance for the ApexCharts load error from the navigation smoke test. With the chart series fix in this PR the dashboard loads with no uncaught errors, so the test asserts an empty error list again.
d9b9296 to
02d1820
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix uncaught ApexCharts error on dashboard load
Fixes #249.
Problem
On every dashboard load, ApexCharts threw an uncaught exception while drawing the system-usage donut:
Root cause
The chart's
serieswas built directly from/system/usage:But
/system/usageomits some keys depending on daemon state — on an empty daemon it returns:{"images":{"shared_size":0,"size":0},"containers":{"size_rootfs":0},"volumes":0,"build_cache":0}— no
layers_size. Soseries[0]wasundefined, and ApexCharts can't render anundefineddata point, which is where the error originates (inside the library'screate()). The chart still rendered, so it was easy to miss, but it was a real uncaught error on load.Fix
Coerce every series value to a finite number (missing →
0) so the series is always valid:Verification
An automated 25-load check (Playwright, listening for
pageerror) went from 25/25 loads erroring → 0/25, and the chart still renders (SVG present, host info populated).Follow-up
This is the error the Playwright navigation smoke test in #248 currently tolerates. Once both this and #248 are merged, that tolerance (and the
KNOWN ISSUE (#249)filter intests/e2e/tests/01-navigation.spec.ts) can be removed.