v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8114

E8114 error

settings.register called more than once

area
stdlib (x8xxx)
fails the build
yes

settings.register is called more than once. An addon has one options category in the game's Settings panel. Put the other pages in subcategories of the one registration.

Example

× failswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "addon": { "saved-variables": ["PlaygroundDB"] }}
src/main.wowluawowlua
import * as settings from "wowlua:settings"import * as saved from "wowlua:saved" local db = saved.bind("PlaygroundDB", { version = 1, defaults = { locked = false, debug = false } }) settings.register({ title = "Playground", store = db, controls = {    settings.checkbox("locked", { label = "Lock frame" }),} })settings.register({ title = "Playground: Advanced", store = db, controls = {    settings.checkbox("debug", { label = "Debug output" }),} })
✓ compileswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "addon": { "saved-variables": ["PlaygroundDB"] }}
src/main.wowluawowlua
import * as settings from "wowlua:settings"import * as saved from "wowlua:saved" local db = saved.bind("PlaygroundDB", { version = 1, defaults = { locked = false, debug = false } }) settings.register({ title = "Playground", store = db, controls = {    settings.checkbox("locked", { label = "Lock frame" }),}, subcategories = {    { title = "Advanced", controls = { settings.checkbox("debug", { label = "Debug output" }) } },} })

The compiler reports it like this:

error[E8114]: `settings.register` is called more than once
   ┌─ src/main.wowlua:9:1
   │    
 6 │   ╭ settings.register({ title = "Playground", store = db, controls = {
 7 │   │     settings.checkbox("locked", { label = "Lock frame" }),
 8 │   │ } })
   │   ╰────' first registered here
 9 │ ╭   settings.register({ title = "Playground: Advanced", store = db, controls = {
10 │ │       settings.checkbox("debug", { label = "Debug output" }),
11 │ │   } })
   │ ╰──────^ again
   │    
   = help: one options page per addon: put more pages in `subcategories`
codemessage
E8080launcher.register called more than once (compile time for top-level calls, otherwise at runtime)

Offline

terminal
$ wowlua explain E8114
E8114 (error): settings.register called more than once

source on GitHub ↗