Skip to content

fix: dashboard empty when opened after scan completes#306

Open
ducky-duke wants to merge 1 commit intoharlan-zw:mainfrom
ducky-duke:fix/dashboard-empty-after-scan
Open

fix: dashboard empty when opened after scan completes#306
ducky-duke wants to merge 1 commit intoharlan-zw:mainfrom
ducky-duke:fix/dashboard-empty-after-scan

Conversation

@ducky-duke
Copy link
Copy Markdown

@ducky-duke ducky-duke commented Apr 15, 2026

Summary

The dashboard shows a blank page when opened after a scan finishes. This fixes three root causes:

  • payload.js never updated: Generated at server startup with reports: [] and never regenerated. Reports were only included when options.static === true (CI mode only). Now always includes completed reports.
  • unctx context lost in async hook: useUnlighthouse() inside the worker-finished hook returned a stale context with 0 reports. Fixed by passing the unlighthouse context explicitly to generateClient().
  • Client had no fallback for late-joining: In dynamic mode, data came exclusively via WebSocket which doesn't replay past events. Now seeds wsReports from payload.js on load and uses native fetch() instead of VueUse's useFetch composable for reliable initial data loading.
  • Missing import: LighthouseThreeD.vue used scanMeta without importing it, causing a ReferenceError.

Changed files

File Change
packages/core/src/build.ts Always include completed reports in payload.js
packages/cli/src/cli.ts Regenerate payload after scan via worker-finished hook
packages/client/logic/state.ts Seed wsReports from payload + use native fetch
packages/client/components/LighthouseThreeD.vue Add missing scanMeta import
image

The dashboard showed a blank page when opened after the scan finished.
Three root causes:

1. payload.js was generated at server startup with empty reports and
   never regenerated. Reports were only included in CI/static mode.

2. The unctx async context was not available inside the worker-finished
   hook callback, so useUnlighthouse() returned a stale context with an
   empty worker when generateClient() was called.

3. In dynamic mode the client relied solely on WebSocket for data, but
   WebSocket doesn't replay past events for late-joining clients.

Changes:
- build.ts: always include completed reports in payload.js
- cli.ts: regenerate payload after scan via worker-finished hook,
  passing the unlighthouse context explicitly to avoid unctx issue
- state.ts: seed wsReports from payload data on module load; replace
  VueUse useFetch with native fetch for initial report loading
- LighthouseThreeD.vue: add missing scanMeta import
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 15, 2026

👷 Deploy request for unlighthouse-crux-api pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c1baabd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant