Skip to content
Gx
GitHub

GX4010: unknown event modifier or special event

An on: directive has a modifier or a special event that Gx does not know.

Cause

An on: directive has a modifier or a special event that Gx does not know.

Example

cart/Cart.gx
package cart

signals {
  Open bool = false
}

<button on:click.twice={$Open = !$Open}>Menu</button>

gx check reports:

gx check
cart/Cart.gx:7:25: GX4010: unknown modifier .twice

Fix

  1. Use one of the modifiers: .prevent, .stop, .once, .outside, .window, .debounce(300ms) or .throttle(1s).
  2. Use one of the special events: load, visible or interval(5s).