Tabs / Steps / FileTree parse HTML at render time via Sätteri, breaking non-Node SSR runtimes (Cloudflare workerd)
What version of starlight are you using?
0.42.0
What version of astro are you using?
7.3.2
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
Tabs, Steps and FileTree call htmlToHast() from satteri at render time (dist/user-components/{tabs,steps,file-tree}-processor.js). Sätteri ships only a native .node binding and a WASI binding, and neither can run in Cloudflare's workerd runtime:
the native .node addon cannot be loaded at all;
the WASI binding (@bruits/satteri-wasm32-wasi) touches node:wasi at module evaluation, and workerd's stub throws The WASI method is not implemented.
So any page containing <Tabs> fails with the Cloudflare adapter, whose default prerenderEnvironment is 'workerd':
[ERROR] Error: The WASI method is not implemented
at new WASI (node:wasi:27:15)
[ERROR] [build] Caught error rendering /example:
Failed to prerender https://example.com/example/: The WASI method is not implementedThe WASI binding's browser entry (satteri_napi.wasi-browser.js) is not usable either — it needs top-level fetch() of the .wasm, new Worker() and a shared WebAssembly.Memory, none of which exist in workerd.
Link to Minimal Reproducible Example
https://github.com/314systems/starlight-bug
Participation
- I am willing to submit a pull request for this issue.
Source: withastro/starlight