Skip to content
Gx
GitHub

GX2003: unknown attribute or slot

A component call passes an attribute that is not a prop of the component.

Cause

A component call passes an attribute that is not a prop of the component. An attribute name is the prop name with a lower-case first letter.

Example

ui/card/Card.gx
package card

props {
  Title string
}

<article>{p.Title}</article>
ui/card/Page.gx
package card

<Card title="News" tilte="Old" />

gx check reports:

gx check
ui/card/Page.gx:3:20: GX2003: unknown attribute "tilte" on <Card>

Fix

  1. Correct the attribute name.
  2. Or add the prop to the props block of the component.