Skip to content
Gx
GitHub

GX2013: value cannot render as text

An expression in text has a type that Gx cannot write as text.

Cause

An expression in text has a type that Gx cannot write as text. Gx writes strings, numbers, booleans, gx.Node values and types with a String method.

Example

ui/card/Card.gx
package card

props {
  Tags map[string]int
}

<p>{p.Tags}</p>

gx check reports:

gx check
ui/card/Card.gx:7:4: GX2013: expression "p.Tags": cannot render a value of type map[string]int

Fix

  1. Change the value to a string in the loader or in a Go function.
  2. Or render each part of the value in a loop.