Skip to content
Gx
GitHub

GX4005: call is not allowed in a client expression

A client expression calls a function that has no JavaScript form.

Cause

A client expression calls a function that has no JavaScript form. A client expression can call the functions of package gxc only.

Example

cart/Cart.gx
package cart

import "strings"

signals {
  Name string = ""
}

<p show={strings.Contains($Name, "a")}>Has an a</p>

gx check reports:

gx check
cart/Cart.gx:9:10: GX4005: only gxc helpers are allowed in a client expression

Fix

  1. Use a gxc function when one does the work.
  2. Or calculate the value on the server and pass it as a prop.