v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / W8101

W8101 warning

Event not available in every selected flavor (shared flavor mode); registered with a runtime validity check

area
stdlib (x8xxx)
fails the build
with --deny-warnings

In shared flavor mode one build runs on every selected flavor. The event registered here doesn't exist in some of them (the message names which). The registration is guarded at run time, so nothing breaks, but there the handler is never called.

If that is what you want, guard the registration with a flavor test so the intent is clear; otherwise use an event every flavor has, or build the flavors separately (split mode).

Example

× failswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "standard": {}, "vanilla": {} },    "build": { "flavor-mode": "shared" }}
src/main.wowluawowlua
import on from "wowlua:events"on("ACTIVE_COMBAT_CONFIG_CHANGED", function() print("changed") end)
✓ compileswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "standard": {}, "vanilla": {} },    "build": { "flavor-mode": "shared" }}
src/main.wowluawowlua
import on from "wowlua:events"if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then    on("ACTIVE_COMBAT_CONFIG_CHANGED", function() print("changed") end)end

The compiler reports it like this:

warning[W8101]: `ACTIVE_COMBAT_CONFIG_CHANGED` is not available in `vanilla`; there the handler is never called
  ┌─ src/main.wowlua:2:4
  │
2 │ on("ACTIVE_COMBAT_CONFIG_CHANGED", function() print("changed") end)
  │    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here
codemessage
E8003Unknown event or message name

Offline

terminal
$ wowlua explain W8101
W8101 (warning): Event not available in every selected flavor (shared flavor mode); registered with a runtime validity check

source on GitHub ↗