v0.13.7
errors and warnings / names

errors and warnings / names / E1038

E1038 error

asset() path is not a package asset (or case mismatch)

area
names (x1xxx)
fails the build
yes
in plain Lua files
reported as W1038

asset(path) names a file that isn't one of the package's assets, or differs from it in case, or the path isn't a constant string. The path is relative to the package root, uses /, and must match a file that build.assets includes, letter case and all. Add the file to build.assets, or fix the path.

Example

× failswowlua
import asset from "wowlua:meta"local icon = asset("media/icon.tga")print(icon)
✓ compileswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "build": { "assets": ["media/**"] }}
media/icon.tgatext
(the image file)
src/main.wowluawowlua
import asset from "wowlua:meta"local icon = asset("media/icon.tga")print(icon)

The compiler reports it like this:

error[E1038]: `media/icon.tga` is not an asset of the package (`build.assets`)
  ┌─ src/main.wowlua:2:14
  │
2 │ local icon = asset("media/icon.tga")
  │              ^^^^^^^^^^^^^^^^^^^^^^^ here
codemessage
E1013Module specifier case does not match the file on disk

Offline

terminal
$ wowlua explain E1038
E1038 (error): asset() path is not a package asset (or case mismatch)

source on GitHub ↗