nexus/ui/src
Nexus Dev 137bd3d0f6 fix(nexus): unblank assistant page on piper-tts import error
The usePiperTts hook imported a non-existent 'tts' namespace from
@mintplex-labs/piper-tts-web@1.0.4. The package exports named
functions (stored, download, predict, etc.) at the top level, not
under a tts namespace. The failing named-import threw at module-link
time, which crashed the lazy chunk for PersonalAssistant.tsx and
left /NEX/assistant blank with only a React error boundary fallback.

Two fixes in one file:

1. Import as namespace:
     import * as tts from "@mintplex-labs/piper-tts-web"
   ESM namespace imports synthesize a 'tts' object whose members are
   the package's named exports, so the existing tts.stored() /
   tts.download() / tts.predict() call sites bind to real functions
   without touching the hook body.

2. Wrap predict() Blob result in URL.createObjectURL() before passing
   to new Audio(). predict() returns Promise<Blob>, not a URL string,
   and Audio() cannot accept a Blob directly. Added a shared cleanup
   callback that revokes the object URL on onended/onerror and in the
   catch path so we don't leak blob URLs on every speak invocation.

Bug 1 was the page-blanking crash at module load. Bug 2 was a latent
runtime crash behind the speak button click handler, surfaced while
the file was already being edited.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:35:01 +00:00
..
adapters feat(nexus): design system phase 3 raw utility sweep 2026-04-10 17:40:32 +00:00
api fix(nexus): auto-bootstrap invite and vite onnxruntime middleware 2026-04-10 16:50:28 +00:00
components feat(nexus): nexus-first navigation and first-run onboarding trigger 2026-04-10 18:19:14 +00:00
context feat(nexus): design system phase 1 tokens and inter font 2026-04-10 17:19:56 +00:00
fixtures Add a run transcript UX fixture lab 2026-03-11 10:47:22 -05:00
hooks fix(nexus): unblank assistant page on piper-tts import error 2026-04-11 10:35:01 +00:00
lib fix(nexus): register missing board route roots for prefix classifier 2026-04-10 17:40:53 +00:00
pages feat(nexus): design system phase 3 raw utility sweep 2026-04-10 17:40:32 +00:00
plugins Enhance plugin loading and toolbar integration 2026-03-14 15:27:45 -07:00
types feat: Phase 41 — Diagrams, Icons & Theme Engine (Mermaid, SVG icons, OKLCH palettes) 2026-04-05 09:56:37 +00:00
App.tsx feat(nexus): nexus-first navigation and first-run onboarding trigger 2026-04-10 18:19:14 +00:00
index.css feat(nexus): design system phase 2 status and role color dictionaries 2026-04-10 17:25:21 +00:00
main.tsx feat(21-04): create ChatPanel shell and wire into Layout and main.tsx 2026-04-04 03:55:47 +00:00
vite-env.d.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00