v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8351

E8351 error

Duplicate keybinding name in the addon

area
stdlib (x8xxx)
fails the build
yes

Two @binding declarations in the addon use the same name. The game knows a binding only by its name, so the second one would replace the first in the Key Bindings UI. Give each binding its own name; the message points at both.

Example

× failswowlua
import binding from "wowlua:bindings" @binding("MYADDON_TOGGLE", { label = "Toggle window" })local function toggleWindow()    print("toggle")end @binding("MYADDON_TOGGLE", { label = "Toggle map" })local function toggleMap()    print("map")end
✓ compileswowlua
import binding from "wowlua:bindings" @binding("MYADDON_TOGGLE", { label = "Toggle window" })local function toggleWindow()    print("toggle")end @binding("MYADDON_TOGGLE_MAP", { label = "Toggle map" })local function toggleMap()    print("map")end

The compiler reports it like this:

error[E8351]: the keybinding `MYADDON_TOGGLE` is declared twice
  ┌─ src/main.wowlua:8:10
  │
3 │ @binding("MYADDON_TOGGLE", { label = "Toggle window" })
  │          ---------------- first declared here
  ·
8 │ @binding("MYADDON_TOGGLE", { label = "Toggle map" })
  │          ^^^^^^^^^^^^^^^^ again
codemessage
E8352Invalid keybinding name (must match [A-Z][A-Z0-9_]*)

Offline

terminal
$ wowlua explain E8351
E8351 (error): Duplicate keybinding name in the addon

source on GitHub ↗