Skip to content
Playground(another site)

bynk.test.principal_on_asset

Error A suite's asset fetch carries a by clause; an asset is public and served before the Worker runs.

An asset is public: the platform serves it before the Worker runs, so no actor's seam ever sees the request. A by clause on an asset fetch would name a principal that nothing checks, so it is refused. Drop the by. To test who may reach something, drive a route, not an asset. A method other than GET is bynk.test.asset_address_method.

Example

demo/web.bynk
asset style = "assets/board.css"
// tests/web.test.bynk
let r <- api.GET(style) by Visitor // ✗ an asset has no principal
let r <- api.GET(style) // ✓

In the Book

See also

  • The grammar rule it governs: case.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.principal_on_asset shows the same from the installed toolchain, without a network.