GX4006: signal or client expression under an adapter with no signals
The app uses the htmx adapter, and a template declares a signal or holds a client expression.
Cause
The gx.toml of the app names the htmx adapter. htmx has no client signals. A template of the app declares a signal, holds a client expression, or uses an event modifier that htmx does not have.
An on: handler that is one route value is not a client expression. It works with each adapter.
Example
adapter = "htmx"package cart
signals {
Open bool = false
}
<section>
<button on:click={$Open = !$Open}>Details</button>
<p show={$Open}>The cart is empty.</p>
</section>gx check reports:
cart/Cart.gx:4:3: GX4006: the htmx adapter has no signals: this component declares signal "Open"
cart/Cart.gx:8:11: GX4006: the htmx adapter has no signals: this on: handler holds signal statements
cart/Cart.gx:9:6: GX4006: the htmx adapter has no signals: the "show" directive is a client expressionFix
- Keep the state on the server. Make an action that patches a fragment.
- Or use an island for state that must live in the browser.
- Or set
adapter = "datastar"ingx.toml, and use the Datastar adapter ingx.Config.