Skip to content
Playground(another site)

bynk.embed.outside_context_or_commons

Error An embed declaration appears outside a context or commons.

An embed is compiled into the Worker of each context that declares it, or that uses a commons that does. An adapter is the host boundary, not a Worker, so it has nowhere to carry the text, and an embed there is refused. Declare it in a context or a commons, and have the context use that. For a file the platform serves rather than compiles in, see bynk.asset.outside_context_or_commons.

Example

app/host.bynk
adapter app.host
binding "./host.binding.ts"
embed shell = "embeds/page.html" // ✗ an adapter cannot embed
// app/page.bynk
commons app.page
embed shell = "embeds/page.html" // ✓ in a commons

In the Book

See also

  • Every code in its category, Embedded text, on the diagnostic index.
  • bynk explain bynk.embed.outside_context_or_commons shows the same from the installed toolchain, without a network.