中文中文版本覆盖全站页面;博文与 CHANGELOG 归档以英文原文发布。
Open navigation

Error codes

The v1.0.0-alpha.5 surface raises 25 OEC compiler diagnostics plus 3 runtime codes. Every row below is rendered from the source that raises it.

01 / code table

The codes, and where they are raised.

OEC90xx codes are compiler diagnostics: each one names a grammar rule the compiled element boundary enforces, and each row lists the exact source call sites the build produced it from. Runtime codes are the ErrorCode constants an application can branch on. A code cannot appear in the source without appearing here.

OEC9000compiler grammar

diagnosticMessage(…)

internal/compiler/semantic-core/compile.ts:466
OEC9001compiler grammar

expected exactly one @element(...) class per compiled module (the decorator must bind the canonical element import from '@openelement/element')

internal/compiler/semantic-core/compile.ts:1839
OEC9002compiler grammar

@element option "…" may appear only once

9 distinct messages: @element option "…" may appear only once · @element options must be an object literal · @element options must be named literal assignments · @element options support only root, delegatesFocus and formAssociated · @element requires a string tag name plus an optional options object · @element root "…" is unsupported; use "light", "shadow-open" or "shadow-closed" · @element root must be a string literal · @element tag "…" is not a custom-element name · @element … must be a boolean literal

internal/compiler/semantic-core/compile.ts:1884 · internal/compiler/semantic-core/compile.ts:1890 · internal/compiler/semantic-core/compile.ts:1904 · internal/compiler/semantic-core/compile.ts:1909 · internal/compiler/semantic-core/compile.ts:1913 · internal/compiler/semantic-core/compile.ts:1918 · internal/compiler/semantic-core/compile.ts:1924 · internal/compiler/semantic-core/compile.ts:1936 · internal/compiler/semantic-core/compile.ts:1945
OEC9003compiler grammar

compiled classes must be named

2 distinct messages: compiled classes must be named · compiled classes must extend the canonical OpenElement import from '@openelement/element' (found ……)

internal/compiler/semantic-core/compile.ts:1965 · internal/compiler/semantic-core/compile.ts:1972
OEC9004compiler grammar

compiled OpenElement classes must carry exactly one @element decorator

6 distinct messages: compiled OpenElement classes must carry exactly one @element decorator · method parameters may not carry decorators in the compiler grammar · methods may not carry decorators in the compiler grammar · unknown decorator on an OpenElement class; use only @element · unknown decorator on an OpenElement member; use only @property · unknown decorator on an OpenElement member; use only @property imported from '@openelement/element'

internal/compiler/semantic-core/compile.ts:1417 · internal/compiler/semantic-core/compile.ts:1432 · internal/compiler/semantic-core/compile.ts:1585 · internal/compiler/semantic-core/compile.ts:1590 · internal/compiler/semantic-core/compile.ts:1849 · internal/compiler/semantic-core/compile.ts:1876
OEC9005compiler grammar

@property reflect must be a boolean literal

9 distinct messages: @property reflect must be a boolean literal · @property requires one options object literal · compiled @property fields must be ordinary initialized instance fields · compiled classes may declare static styles only once · compiled fields must carry exactly one @property decorator · compiled fields require a literal initializer · duplicate property "…" · property names must be identifiers · static styles requires an initializer

internal/compiler/semantic-core/compile.ts:1375 · internal/compiler/semantic-core/compile.ts:1378 · internal/compiler/semantic-core/compile.ts:1404 · internal/compiler/semantic-core/compile.ts:1410 · internal/compiler/semantic-core/compile.ts:1438 · internal/compiler/semantic-core/compile.ts:1441 · internal/compiler/semantic-core/compile.ts:1445 · internal/compiler/semantic-core/compile.ts:1469 · internal/compiler/semantic-core/compile.ts:1492
OEC9006compiler grammar

compiled @element classes must be exported (optionally as the default export) without other class modifiers

4 distinct messages: compiled @element classes must be exported (optionally as the default export) without other class modifiers · compiled methods must be concrete instance methods · constructors, accessors and undecorated fields are outside the compiler grammar · method names must be identifiers

internal/compiler/semantic-core/compile.ts:1582 · internal/compiler/semantic-core/compile.ts:1595 · internal/compiler/semantic-core/compile.ts:1615 · internal/compiler/semantic-core/compile.ts:1866
OEC9007compiler grammar

compiled classes may declare only one render() method

6 distinct messages: compiled classes may declare only one render() method · compiled classes must declare render() · render() must be a single return of one JSX element · render() must be a synchronous zero-argument method · render() must return a single JSX element · render() must return one intrinsic JSX element

internal/compiler/semantic-core/compile.ts:625 · internal/compiler/semantic-core/compile.ts:1599 · internal/compiler/semantic-core/compile.ts:1605 · internal/compiler/semantic-core/compile.ts:1619 · internal/compiler/semantic-core/compile.ts:1987 · internal/compiler/semantic-core/compile.ts:1991
OEC9008compiler grammar

runtime top-level statements are outside the compiled module grammar

internal/compiler/semantic-core/compile.ts:1807
OEC9010compiler grammar

component tag <…> is outside the compiler grammar (intrinsic lowercase elements and custom-element hosts only)

4 distinct messages: component tag <…> is outside the compiler grammar (intrinsic lowercase elements and custom-element hosts only) · itemTagReason · list Region item must be an intrinsic lowercase element · tagReason

internal/compiler/semantic-core/compile.ts:653 · internal/compiler/semantic-core/compile.ts:658 · internal/compiler/semantic-core/compile.ts:1225 · internal/compiler/semantic-core/compile.ts:1228
OEC9011compiler grammar

attribute name "…" is unsafe

14 distinct messages: attribute "…" must be a literal or a supported expression · attribute "…" must be a literal, this.<property>, or a supported expression · attribute "…" only accepts primitive literal values · attribute name "…" is unsafe · duplicate attribute "…" is unsupported · item template attribute "…" must be a static literal or {….<field>} · item template attributes must be static literals · item template attributes must use primitive literals · key is only supported on the list Region item root · list Region items do not support spread attributes · property sink name "…" is unsafe · ref must reference this.<field> · spread attributes are not supported by the compiler grammar · spread attributes are not supported in item templates

internal/compiler/semantic-core/compile.ts:675 · internal/compiler/semantic-core/compile.ts:686 · internal/compiler/semantic-core/compile.ts:698 · internal/compiler/semantic-core/compile.ts:702 · internal/compiler/semantic-core/compile.ts:716 · internal/compiler/semantic-core/compile.ts:732 · internal/compiler/semantic-core/compile.ts:761 · internal/compiler/semantic-core/compile.ts:781 · internal/compiler/semantic-core/compile.ts:787 · internal/compiler/semantic-core/compile.ts:1014 · internal/compiler/semantic-core/compile.ts:1021 · internal/compiler/semantic-core/compile.ts:1027 · internal/compiler/semantic-core/compile.ts:1160 · internal/compiler/semantic-core/compile.ts:1235 · internal/compiler/semantic-core/compile.ts:1240 · internal/compiler/semantic-core/compile.ts:1245 · internal/compiler/semantic-core/compile.ts:1249 · internal/compiler/semantic-core/compile.ts:1261 · internal/compiler/semantic-core/compile.ts:1279 · internal/compiler/semantic-core/compile.ts:1285
OEC9012compiler grammar

Region branches must be fully static

3 distinct messages: Region branches must be fully static · conditional Region branches must be single static JSX elements · nested Regions are outside the compiler grammar

internal/compiler/semantic-core/compile.ts:722 · internal/compiler/semantic-core/compile.ts:730 · internal/compiler/semantic-core/compile.ts:738 · internal/compiler/semantic-core/compile.ts:1041 · internal/compiler/semantic-core/compile.ts:1056 · internal/compiler/semantic-core/compile.ts:1070 · internal/compiler/semantic-core/compile.ts:1128
OEC9013compiler grammar

list Region mapper must return one JSX element

12 distinct messages: JSX fragments and spreads are outside the compiler grammar · conditional Regions support this.<property> compared with a numeric literal (>, >=, <, <=), a number/string/boolean equality (===, !==), or a bare this.<property> (optionally negated) truthiness test · dynamic child literals must be primitive values · item child must be {….<field>} · item templates support static text, item values and intrinsic elements · list Region items must bind at least one {<item>.<field>} value or attribute slot · list Region mapper must be a single-parameter arrow function · list Region mapper must return one JSX element · list Regions must map over this.<property> · list Regions support exactly this.<property>.map(...) · unsupported dynamic expression; use this.<property>, a supported condition, or this.<array>.map(...) · void element <…> may not have children

internal/compiler/semantic-core/compile.ts:844 · internal/compiler/semantic-core/compile.ts:849 · internal/compiler/semantic-core/compile.ts:1049 · internal/compiler/semantic-core/compile.ts:1076 · internal/compiler/semantic-core/compile.ts:1107 · internal/compiler/semantic-core/compile.ts:1137 · internal/compiler/semantic-core/compile.ts:1140 · internal/compiler/semantic-core/compile.ts:1146 · internal/compiler/semantic-core/compile.ts:1149 · internal/compiler/semantic-core/compile.ts:1153 · internal/compiler/semantic-core/compile.ts:1187 · internal/compiler/semantic-core/compile.ts:1294 · internal/compiler/semantic-core/compile.ts:1320 · internal/compiler/semantic-core/compile.ts:1328
OEC9014compiler grammar

key must be key={<item>.<field>}

4 distinct messages: key must be key={<item>.<field>} · key must reference ….<field> · list Region items may declare key only once · list Region items require key={<item>.<field>}

internal/compiler/semantic-core/compile.ts:1163 · internal/compiler/semantic-core/compile.ts:1167 · internal/compiler/semantic-core/compile.ts:1176 · internal/compiler/semantic-core/compile.ts:1179
OEC9015compiler grammar

… part path […] is preceded by a dynamic anchor; path-addressed fixed sinks must appear before any dynamic anchor sibling

internal/compiler/semantic-core/compile.ts:1723
OEC9016compiler grammar

event arithmetic supports only numeric += or -= literals

6 distinct messages: event arithmetic supports only numeric += or -= literals · event arrow handlers must contain exactly one supported action · event assignment values must be serializable literals · event handlers must be this.<method> or a single-action arrow · event mutations support only this.<number>++ or -- · unsupported event action; use this.<field>++, assignment or this.<method>()

internal/compiler/semantic-core/compile.ts:886 · internal/compiler/semantic-core/compile.ts:898 · internal/compiler/semantic-core/compile.ts:929 · internal/compiler/semantic-core/compile.ts:941 · internal/compiler/semantic-core/compile.ts:958 · internal/compiler/semantic-core/compile.ts:966
OEC9017compiler grammar

custom-element host <…> may not carry a ref

3 distinct messages: custom-element host <…> may not carry a ref · custom-element host <…> may not carry event handlers · custom-element host <…> may not have children in the compiler grammar (slots are unsupported)

internal/compiler/semantic-core/compile.ts:683 · internal/compiler/semantic-core/compile.ts:728 · internal/compiler/semantic-core/compile.ts:1299
OEC9020compiler grammar

property defaults must be serializable literals

internal/compiler/semantic-core/compile.ts:1465
OEC9021compiler grammar

property type/converter must be one of String, Number, Boolean, Array or Object

internal/compiler/semantic-core/compile.ts:314
OEC9022compiler grammar

@property option "…" may appear only once

3 distinct messages: @property option "…" may appear only once · @property options must be named literal assignments · unsupported @property option "…"

internal/compiler/semantic-core/compile.ts:1480 · internal/compiler/semantic-core/compile.ts:1484 · internal/compiler/semantic-core/compile.ts:1516
OEC9023compiler grammar

a property with attribute: false cannot reflect

4 distinct messages: a property with attribute: false cannot reflect · duplicate property attribute "…" · property attribute must be a string literal or false · property attribute name is unsafe

internal/compiler/semantic-core/compile.ts:1503 · internal/compiler/semantic-core/compile.ts:1506 · internal/compiler/semantic-core/compile.ts:1543 · internal/compiler/semantic-core/compile.ts:1548
OEC9024compiler grammar

computed field arrows may not declare parameters

9 distinct messages: computed field arrows may not declare parameters · computed field arrows may not nest non-arrow functions · computed field arrows may only reference this.<property> · computed field arrows use an expression body, not a block · computed field arrows use an expression body, not a block (keep derived values atomic) · computed field may not read computed field "…" · computed fields may only read this.<declared property> (found this.…) · computed fields take exactly one zero-argument arrow function · event actions may not write computed field "…" — assign its source properties

internal/compiler/semantic-core/compile.ts:358 · internal/compiler/semantic-core/compile.ts:362 · internal/compiler/semantic-core/compile.ts:372 · internal/compiler/semantic-core/compile.ts:376 · internal/compiler/semantic-core/compile.ts:383 · internal/compiler/semantic-core/compile.ts:388 · internal/compiler/semantic-core/compile.ts:393 · internal/compiler/semantic-core/compile.ts:402 · internal/compiler/semantic-core/compile.ts:917
OEC9025compiler grammar

computed fields require @property({ reflect: false, attribute: false }) — derived signals have no attribute channel

2 distinct messages: computed fields require @property({ reflect: false, attribute: false }) — derived signals have no attribute channel · computed fields require the canonical computed import: a runtime named import of computed from '@openelement/element'…

internal/compiler/semantic-core/compile.ts:349 · internal/compiler/semantic-core/compile.ts:1534
OEC9026compiler grammar

an innerHTML sink target must be otherwise childless (the sink owns its content)

8 distinct messages: an innerHTML sink target must be otherwise childless (the sink owns its content) · innerHTML sinks require an Object-typed TrustedHtml property · innerHTML sinks require the explicit trustedHtml capability marker · trustedHtml capability marker must be the literal true · trustedHtml capability marker requires an innerHTML sink · trustedHtml field defaults require the canonical trustedHtml import: a runtime named import of trustedHtml from '@openelement/element'… · trustedHtml field defaults require type: Object, reflect: false, and attribute: false · void element <…> cannot carry an innerHTML sink

internal/compiler/semantic-core/compile.ts:270 · internal/compiler/semantic-core/compile.ts:670 · internal/compiler/semantic-core/compile.ts:798 · internal/compiler/semantic-core/compile.ts:806 · internal/compiler/semantic-core/compile.ts:995 · internal/compiler/semantic-core/compile.ts:1002 · internal/compiler/semantic-core/compile.ts:1007 · internal/compiler/semantic-core/compile.ts:1525
OEC9027compiler grammar

unsupported @element provenance: …

2 distinct messages: unsupported @element provenance: … · unsupported @property provenance: …

internal/compiler/semantic-core/compile.ts:1426 · internal/compiler/semantic-core/compile.ts:1831
BOUNDARY_CAUGHTruntime

BOUNDARY_CAUGHT
SSR_RENDER_ERRORruntime

SSR_RENDER_ERROR
UNKNOWNruntime

UNKNOWN

The gloss is the message the code raises most often; a code with several call-site messages expands to the full list. Source paths are repository-relative.

Generated from the diagnostics by deno task --cwd www check:error-codes, so a new code cannot ship unlisted and a retired one cannot stay listed.