errors and warnings / stdlib / E8020
E8020 error
saved.bind on a SavedVariable not declared in the manifest
- area
- stdlib (x8xxx)
- fails the build
- yes
saved.bind names a SavedVariable that the manifest doesn't declare. The game
only saves variables that the TOC lists, and wowlua writes the TOC from
addon.saved-variables and addon.saved-variables-per-character, so this data
would never be saved.
Add the name to one of the two lists in wowlua.json, or fix its spelling.
Example
import * as saved from "wowlua:saved"local db = saved.bind("MyAddonDB", { version = 1, defaults = { scale = 1 } })print(db){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "addon": { "saved-variables": ["MyAddonDB"] }}import * as saved from "wowlua:saved"local db = saved.bind("MyAddonDB", { version = 1, defaults = { scale = 1 } })print(db)The compiler reports it like this:
error[E8020]: `MyAddonDB` is not declared in `addon.saved-variables` or `addon.saved-variables-per-character` ┌─ src/main.wowlua:2:23 │ 2 │ local db = saved.bind("MyAddonDB", { version = 1, defaults = { scale = 1 } }) │ ^^^^^^^^^^^ not in the manifest
Related codes
| code | message |
|---|---|
| E8102 | saved.bind name is not a string literal |
| E8103 | SavedVariable bound twice with saved.bind |
Offline
$ wowlua explain E8020 E8020 (error): saved.bind on a SavedVariable not declared in the manifest