Summary
When a component's <script server> throws, the component renders as nothing. No error, no fallback, no message — even with debug: true. The page simply has a hole where the UI was.
Reproduction
<CodeBlock code="const x = 1" /> where its server block cannot load its highlighter:
<div data-stx-scope="stx_code_block_1_2cmbai" data-stx-props="{"code":"const x = 1"}">
<div class="relative group">
</div>
</div>The markup skeleton survives; everything the server block computed is gone, and every that depended on it resolves to nothing. Console output with debug: true: nothing.
Why this is expensive
The symptom points nowhere near the cause. In this case the real failure was ts-syntax-highlighter@0.2.17 shipping a bundle that imports bunfig while declaring no dependencies, so a static import threw wherever that package was not reachable. What the developer sees is an empty div. Finding the actual error took instrumenting the pipeline by hand.
It also hides upstream breakage indefinitely: a dependency can start throwing and every page keeps rendering "successfully", just without that component.
Ask
- Log the error when a
<script server>block throws — file, component name and the original stack. Unconditionally atdebug: true, and at least once per process otherwise. - In development, render a visible error boundary in place of the component rather than an empty element.
- Consider surfacing it through the existing
@errorBoundarymachinery, so an app can decide what a failed component looks like in production.