errors and warnings / names / W1033
W1033 warning
Load order cannot be determined (dynamic names, several writers, external names); files keep their source order
- area
- names (x1xxx)
- fails the build
- with --deny-warnings
wowlua can't tell in which order some files must load, so they keep their
source order (their place in build.load-order, then their path). The
warning names the globals or fields that cause it: several files define the
same name while loading, a name is written through a dynamic key
(_G["x" .. i], ns[key]), or names come from outside the package. Give the
name a single defining file, or fix the order with an import (import _ from "./file") or build.load-order.
Example
MyAddonDB = {}MyAddonDB = { version = 2 }print(MyAddonDB.version)MyAddonDB = {}MyAddonDB.version = 2print(MyAddonDB.version)The compiler reports it like this:
warning[W1033]: the load order of the files defining `MyAddonDB` cannot be determined; they keep their source order ┌─ src/a.lua:1:1 │ 1 │ MyAddonDB = {} │ ^^^^^^^^^ defined here at load time │ ┌─ src/b.lua:1:1 │ 1 │ MyAddonDB = { version = 2 } │ --------- defined here at load time │ = help: import the module that should load first, or list the files in `build.load-order`
Related codes
| code | message |
|---|---|
| W1034 | Name read at load time but only defined at run time |
| W1035 | Usage-analysis dependency contradicts build.load-order; the listed order is kept (contradicting imports are E1035) |
Offline
$ wowlua explain W1033 W1033 (warning): Load order cannot be determined (dynamic names, several writers, external names); files keep their source order