Skip to content
Gx
GitHub

GX2002: unknown component

A tag with an upper-case name is a component, and no component has that name.

Cause

A tag with an upper-case name is a component, and no component has that name. The message gives the nearest name.

Example

ui/card/Card.gx
package card

props {
  Title string
}

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

<Crad title="News" />

gx check reports:

gx check
ui/card/Page.gx:3:1: GX2002: unknown component "Crad"; did you mean "Card"?

Fix

  1. Correct the name.
  2. For a component in a different package, import the package and write pkg.Name.