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
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")endimport 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")endThe 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
Related codes
| code | message |
|---|---|
| E8352 | Invalid keybinding name (must match [A-Z][A-Z0-9_]*) |
Offline
$ wowlua explain E8351 E8351 (error): Duplicate keybinding name in the addon