In "on_built_entity", you overwrite the "entity"-key from the event with the "created_entity"-key. A "script_raised_built"-event has no "created_entity"-key, just an "entity"-key. This fixes it:
if event.entity == nil then
event.entity = event.created_entity
end
The mod Neo Hazard Lights (0.0.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event neo-hazard-lights::on_configuration_changed
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__neo-hazard-lights/control.lua:229: in function 'verify_lamps_data' neo-hazard-lights/control.lua:618: in function <neo-hazard-lights/control.lua:618>