v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8080

E8080 error

launcher.register called more than once (compile time for top-level calls, otherwise at runtime)

area
stdlib (x8xxx)
fails the build
yes

launcher.register is called more than once. An addon has one launcher: one minimap button, one Addon Compartment entry and one LDB object. The compiler counts the calls that are statements at the top level of your files, and reports a second one. Any other second call, such as one in a function that runs twice or in a branch, raises an error at run time instead.

Register once, and change the launcher later with launcher.setIcon, setLabel, showMinimap and refresh.

Example

× failswowlua
import * as launcher from "wowlua:launcher" launcher.register({ icon = "Interface\\Icons\\INV_Misc_QuestionMark", label = "Playground", onClick = function() end })launcher.register({ icon = "Interface\\Icons\\INV_Misc_Book_09", label = "Playground", onClick = function() end })
✓ compileswowlua
import * as launcher from "wowlua:launcher" launcher.register({ icon = "Interface\\Icons\\INV_Misc_QuestionMark", label = "Playground", onClick = function() end })launcher.setIcon("Interface\\Icons\\INV_Misc_Book_09")

The compiler reports it like this:

error[E8080]: `launcher.register` is called more than once
  ┌─ src/main.wowlua:4:1
  │
3 │ launcher.register({ icon = "Interface\\Icons\\INV_Misc_QuestionMark", label = "Playground", onClick = function() end })
  │ ----------------------------------------------------------------------------------------------------------------------- first registered here
4 │ launcher.register({ icon = "Interface\\Icons\\INV_Misc_Book_09", label = "Playground", onClick = function() end })
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ again
codemessage
E8114settings.register called more than once

Offline

terminal
$ wowlua explain E8080
E8080 (error): launcher.register called more than once (compile time for top-level calls, otherwise at runtime)

source on GitHub ↗