Skip to content
Gx
GitHub

GX2014: signal needs an initial value

A signal in the signals block has no first value.

Cause

A signal in the signals block has no first value. The browser needs a value before the first event.

Example

cart/Cart.gx
package cart

signals {
  Qty int
}

<p text={$Qty}></p>

gx check reports:

gx check
cart/Cart.gx:4:3: GX2014: signal "Qty" needs an initial value

Fix

Give the signal a first value, for example Qty int = 1.