Summary
A @click (or any @event=) on a page with no client script is compiled away and never wired up. The element renders with an id and nothing else. There is no console error and no warning — the button simply does nothing, forever.
This is not SPA-specific. It happens on first full page load.
Repro
<main>
<button @click="useStore('cart').add(1)">Add</button>
</main>Through processDirectives:
<main><button id="__stx_evt_0">Add</button></main>markers: {"setup":false,"scope":false,"reactive":false,"winstx":false,"auto":false,"dataStx":false,"runtime":false}
The handler is gone, no data-stx-events script is emitted anywhere in the page, and no runtime is shipped.
Cause
prepareDirectiveContext sets context.__stx_sfc_mode = true unconditionally (process.ts:1181), so processEventDirectives takes the SFC branch (events.ts:608) and parks the binding on context.__stx_event_bindings instead of emitting a handler. Those parked bindings are only re-emitted while transforming a client script (process.ts:1746-1795).
No client script ⇒ no consumer ⇒ the binding is silently discarded.
Why it matters
@click calling into a store or a global is a reasonable thing to write with no local state — it is the shape the docs encourage for store-backed actions. The failure is completely silent, which is the worst property: nothing in the page hints that the attribute was understood and then thrown away.
Suggested direction
Either emit the delegated handler script when bindings are parked but no client script exists, or refuse to park in the first place when there is no script to consume them. A dev-mode warning when __stx_event_bindings is non-empty at the end of processing would surface the whole class cheaply.