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
{ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "standard": {}, "vanilla": {} }, "build": { "flavor-mode": "shared" }}import on from "wowlua:events"on("ACTIVE_COMBAT_CONFIG_CHANGED", function() print("changed") end){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "standard": {}, "vanilla": {} }, "build": { "flavor-mode": "shared" }}import on from "wowlua:events"if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then on("ACTIVE_COMBAT_CONFIG_CHANGED", function() print("changed") end)endThe 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
Related codes
| code | message |
|---|---|
| E8003 | Unknown event or message name |
Offline
$ wowlua explain W8101 W8101 (warning): Event not available in every selected flavor (shared flavor mode); registered with a runtime validity check