v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8103

E8103 error

SavedVariable bound twice with saved.bind

area
stdlib (x8xxx)
fails the build
yes

The same SavedVariable is bound with saved.bind twice in the addon. Each binding would load, fill with defaults and strip the same data on its own, so the two tables would fight over it.

Bind it once, in one module, and export the returned table to the modules that need it.

Example

× failswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "addon": { "saved-variables": ["MyAddonDB"] }}
src/main.wowluawowlua
import * as saved from "wowlua:saved"local db = saved.bind("MyAddonDB", { version = 1, defaults = {} })local again = saved.bind("MyAddonDB", { version = 1, defaults = {} })print(db, again)
✓ compileswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "addon": { "saved-variables": ["MyAddonDB"] }}
src/db.wowluawowlua
import * as saved from "wowlua:saved"export const db = saved.bind("MyAddonDB", { version = 1, defaults = {} })
src/main.wowluawowlua
import db from "/db"print(db)

The compiler reports it like this:

error[E8103]: `MyAddonDB` is bound twice
  ┌─ src/main.wowlua:3:15
  │
2 │ local db = saved.bind("MyAddonDB", { version = 1, defaults = {} })
  │            ------------------------------------------------------- first bound here
3 │ local again = saved.bind("MyAddonDB", { version = 1, defaults = {} })
  │               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ again
codemessage
E8020saved.bind on a SavedVariable not declared in the manifest
E8102saved.bind name is not a string literal

Offline

terminal
$ wowlua explain E8103
E8103 (error): SavedVariable bound twice with saved.bind

source on GitHub ↗