Skip to content
Gx
GitHub

GX4007: value or operator is not allowed in a client expression

A client expression uses a value or an operator that does not give the same result in Go and in JavaScript.

Cause

A client expression uses a value or an operator that does not give the same result in Go and in JavaScript. bind: takes one signal and no other expression.

Example

cart/Cart.gx
package cart

signals {
  Qty int = 1
}

<input bind:value={$Qty + 1} />

gx check reports:

gx check
cart/Cart.gx:7:20: GX4007: bind: targets one signal

Fix

  1. For bind:, give the signal only, for example bind:value={$Qty}.
  2. For other directives, use bool, string, int and float64 values with the operators that the two languages share.