Skip to content

E0124: Code that can't run in the browser ​

A client-side expression (one reading a ui.State, kept current in the browser) is translated to JavaScript, and only state reads, literals and a small set of operators translate. A function call or another operator has to run on the server.

Wrong ​

html
<!-- tabs.vuka.html -->
<script lang="go">
type Tabs struct {
	tab ui.State[string]
}
</script>

<p>{strings.ToUpper(tab)}</p>
html
<!-- tabs.vuka.html -->
<script lang="go">
type Tabs struct {
	tab ui.State[string]
}
</script>

<p>{tab}</p>   <!-- kept current in the browser; or compute the text on the server -->

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.