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
import asset from "wowlua:meta"local icon = asset("media/icon.tga")print(icon){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "build": { "assets": ["media/**"] }}(the image file)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
Related codes
| code | message |
|---|---|
| E1013 | Module specifier case does not match the file on disk |
Offline
$ wowlua explain E1038 E1038 (error): asset() path is not a package asset (or case mismatch)