E-CHANNEL-INSIDE-PAGE
<channel> is not permitted inside <page>.
NOT CURRENTLY EMITTED — verified 2026-07-26 against v0.7.1. This code is registered in the §34 catalogue but no walker fires it. The compiler source says so directly (symbol-table.ts: "the error code is registered in §34 now but no walker fires it yet") and the probe below confirms it: a <channel> inside a <page> compiles clean and the build reports "WebSocket channels: 1 channel(s) wired". The rule above is the specified behaviour and the shape you should write; it is simply not enforced today, so nothing will stop you getting it wrong. Reported upstream.
What it means
Channels are program-scoped: they own a WebSocket route for the whole application, not for one route within it. Declaring one inside a <page> implies a per-page channel lifetime the runtime does not provide. The canonical placements are inside <program>, or at file top in a pure-channel module file.
Minimal reproducer
This is the exact source compiled against the linked compiler to establish the behaviour described above. Read the callout at the top of this page before using it — it does not produce E-CHANNEL-INSIDE-PAGE.
app.scrml
<program title="p">
<outlet/>
</>
pages/index.scrml
<page>
<channel name="chat">
<messages> = []
</>
<p>${@messages.length}</p>
</>
How to fix
-
Move the channel into
<program>. Declare it once at program scope and read its cells from any page. -
Use a pure-channel module file.
A file with no
<program>element may declare a<channel>at file top and export it.
Related
Specification
Normative text: §38.1, §38.4.1, §38.9, §40.8, §34. Spec lives at compiler/SPEC.md .