Skip to content
Playground(another site)

bynk.types.field_name_invalid

Error A field's @name is not a valid name for where the record is read (a cookie name that is not a token, or an empty name).

A @name has to be usable as a key where the record is read. It may not be empty, and on a cookies record it must be a cookie name, an RFC 9110 token: no spaces, quotes or separators such as ; , or =. A name the request could never carry would make the field unreachable. Use a valid token, such as __Host-sid.

Example

type Session = {
@name("session id") sid: Option[String], // ✗ a space is not allowed in a cookie name
}
type Session = {
@name("session-id") sid: Option[String], // ✓
}

In the Book

See also

  • The grammar rule it governs: record_field.
  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.field_name_invalid shows the same from the installed toolchain, without a network.