Files
ai-spel-frontend/docs/adr/0001-piper-es-module-worker.md
Ein Anderssono d26d7f0b55
Build and publish frontend / publish (push) Successful in 46s
Run Piper ONNX in a module worker
2026-10-16 07:45:21 +02:00

14 lines
806 B
Markdown

# ADR 0001: Run Piper in an ES module worker
## Decision
Bundle the Piper worker as an ES module and start it with `new Worker(url, { type: 'module' })`.
## Context
Piper loads ONNX Runtime Web and its WebAssembly loader dynamically. The current IIFE/classic worker bundle reports `TypeError: "undefined" cannot be parsed as a URL` during WASM backend initialization, even though the pinned same-origin ONNX loader and binary are available. This is consistent with module-relative URL metadata being lost in the classic bundle.
## Consequences
The browser must support module workers. Current supported browser targets already require modern WebAssembly and worker support. CI asserts that the worker is built and started in module mode; production acceptance remains the real deployed browser flow.