Skip to content
Gx
GitHub

GX2010: signal in a server expression

A signal is used in a server expression.

Cause

A signal is used in a server expression. A signal has a value in the browser only.

Example

cart/Cart.gx
package cart

signals {
  Qty int = 1
}

<p>{$Qty}</p>

gx check reports:

gx check
cart/Cart.gx:7:4: GX2010: a signal is only valid in a client expression

Fix

  1. Use the signal in a client expression: show, text, bind:, class:, attr: or on:.
  2. For the first value on the server, use the prop that sets the signal.