Skip to content
Playground(another site)

bynk.asset.outside_context_or_commons

Error An asset declaration appears outside a context or commons.

An asset is a file the platform serves, shipped with each context that declares it or uses a commons that does. An adapter is the host boundary, not a deployed unit of its own, so an asset there is refused. Declare it in a context or a commons. For text compiled into the program rather than served, see bynk.embed.outside_context_or_commons.

Example

app/host.bynk
adapter app.host
binding "./host.binding.ts"
asset style = "assets/board.css" // ✗ an adapter cannot declare an asset
// app/page.bynk
commons app.page
asset style = "assets/board.css" // ✓ in a commons

In the Book

See also

  • Every code in its category, Static assets, on the diagnostic index.
  • bynk explain bynk.asset.outside_context_or_commons shows the same from the installed toolchain, without a network.