Skip to content

E0157: A Go script that is not the file's first element ​

A .vuka.html file has one <script lang="go">, and it comes first: only blank lines and <!-- comments --> go above it. The markup is what follows it. A <script lang="go"> further down, below markup or a second one, is reported. Other scripts — <script lang="ts">, <script is:inline>, a plain <script> — are the markup's, and go anywhere.

Wrong ​

html
<!-- card.vuka.html -->
<h2>{Title}</h2>

<script lang="go">
package components

type Card struct{ Title string }
</script>
html
<!-- card.vuka.html -->
<script lang="go">
package components

type Card struct{ Title string }
</script>

<h2>{Title}</h2>

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.