v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8420

E8420 error

Unknown callback event name for the registry's event type

area
stdlib (x8xxx)
fails the build
yes

The event name given to a wowlua:callbacks registry (on, once, off, offAll) must be a string literal naming a key of the registry's event type. That is how the handler is checked against the event's signature. Fix the spelling, add the event to the interface, or pass the name as a literal instead of a variable.

Example

× failswowlua
import * as callbacks from "wowlua:callbacks" interface TrackerEvents    KillRecorded: (count: number) -> ()end local events: callbacks.Registry<TrackerEvents> = callbacks.registry()events:on("KillsRecorded", function(count: number)    print(count)end)
✓ compileswowlua
import * as callbacks from "wowlua:callbacks" interface TrackerEvents    KillRecorded: (count: number) -> ()end local events: callbacks.Registry<TrackerEvents> = callbacks.registry()events:on("KillRecorded", function(count: number)    print(count)end)

The compiler reports it like this:

error[E8420]: `KillsRecorded` is not an event of `TrackerEvents`
  ┌─ src/main.wowlua:8:11
  │
8 │ events:on("KillsRecorded", function(count: number)
  │           ^^^^^^^^^^^^^^^ here

Offline

terminal
$ wowlua explain E8420
E8420 (error): Unknown callback event name for the registry's event type

source on GitHub ↗