Guide / 19 β€” Troubleshooting

Troubleshooting

This section provides solutions to the most common issues you might encounter while developing with Stew-Lang.

πŸ”„

Wasm Script Not Updating

Browsers cache .wasm files aggressively for performance.

Solution: Hard Reload (Ctrl + F5) or use Incognito mode.
πŸ› οΈ

TinyGo Not Found

Stew delegates client binary generation to tinygo. Without it, interactivy won't work.

Solution: Install TinyGo and ensure it's in your $PATH.
πŸ”

404 on New Pages

New pages/folders aren't automatically picked up by the compiled router until it's regenerated.

Solution: Run stew generate to update stew_router_gen.go.
πŸ’₯

Wasm Crash (Panic)

Seeing a Go stack trace in the console? It's likely an incompatible import in your client script.

Solution: Avoid packages like os, net, or reflect in client scripts.
⚑

Missing Reactivity

UI not updating? Ensure you actually call .Get() in your expressions.

Note: Reactivity is disabled inside HTML attributes (like class) to prevent DOM corruption.
πŸ”₯

Hot Morphing Silent Failure

Page reloads instead of morphing? Check your layout dependencies.

Solution: Verify hx-ext="morph" on <body> and Idiomorph scripts in <head>.
πŸ“¦

PageData JSON Issues

Empty stew/data? Ensure your server structs are serializable (exported fields).

Note: Unexported fields or complex types (func, chan) are ignored by JSON.
🚧

Unexpected Build Failures

Errors in stew.page.go? Check reserved file prefixes.

Solution: Main handlers MUST be named stew.server.go or stew.middleware.go.

Still stuck? No worries.

Every edge case cannot be listed here. For any other questions, technical hurdles, or if you think you found a bug in the compiler:

The Stew team and the community are here to support your journey.