Skip to content

T4015: Behavior event used without its behavior ​

Cause ​

A behavior event such as @press is used, but this component's contract does not declare the behavior that provides it.

Example ​

xml
<contract>
{ "name": "Card", "role": "group", "parts": ["root"], "events": { "press": "x" } }
</contract>
<script>
function go() {}
</script>
<template><div class="root" @press="go"></div></template>

What you see ​

text
ERROR  T4015  app/components/Card.tess:7:29
  @press is an event of the "press" behavior, but this component's contract does not declare it.
  Add "behavior": "press" to <contract>.
  Run `tessera explain T4015` for details.

Fix ​

Add "behavior": "press" (and its events) to the contract, or use a native event such as @click.

All errors and warnings