Skip to content
Playground(another site)

bynk.messages.outside_commons

Error A messages declaration appears outside a commons.

A messages block is pure, stateless data, which is what a commons holds. A context carries services and state and an adapter wraps foreign code, and neither takes a bundle. Move the bundle into a commons, with the two uses lines it needs, and have the context uses that commons.

Example

context shop.web
messages "en" @reference { … } // ✗ a context cannot hold a bundle
commons shop.messages
uses bynk.locale
uses bynk.locale.types
messages "en" @reference { … } // ✓ a commons can

In the Book

See also

  • Every code in its category, Message bundles, on the diagnostic index.
  • bynk explain bynk.messages.outside_commons shows the same from the installed toolchain, without a network.