v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8001

E8001 error

send used with a WoW event (only messages can be sent)

area
stdlib (x8xxx)
fails the build
yes

send from wowlua:events dispatches a message to your own addon's handlers. WoW events such as PLAYER_LOGIN come from the game client and can't be sent by an addon, so passing one to send is an error.

Declare your own message with declare message and send that instead; handlers subscribe to it with on like to any event.

Example

× failswowlua
import send from "wowlua:events"send("PLAYER_LOGIN")
✓ compileswowlua
import on, send from "wowlua:events" declare message MYADDON_READY() on("MYADDON_READY", function() print("ready") end)send("MYADDON_READY")

The compiler reports it like this:

error[E8001]: `PLAYER_LOGIN` is a WoW event; only messages can be sent
  ┌─ src/main.wowlua:2:6
  │
2 │ send("PLAYER_LOGIN")
  │      ^^^^^^^^^^^^^^ a WoW event
codemessage
E8003Unknown event or message name

Offline

terminal
$ wowlua explain E8001
E8001 (error): send used with a WoW event (only messages can be sent)

source on GitHub ↗