FyroxEngine/Fyrox · warning

Script message was sent, but there's no receivers. Did you…

Error message

Script message {message:?} was sent, but there's no receivers. Did you forgot to subscribe your script to the message?

What it means

Engine::dispatch_messages routes script messages by payload type to registered receiver groups. If no script has subscribed to the message's type, the message is silently dropped and this warning is logged, hinting that the intended script likely forgot to subscribe.

Solutions

  1. Call context.subscribe_to::<MessageType>() in the script's on_start for each message it handles
  2. Verify the script instance that should receive the message exists on some scene node
  3. Check the message type matches exactly what receivers subscribed to

Example fix

// before
fn on_start(&mut self, context: &mut ScriptContext) { /* no subscription */ }
// after
fn on_start(&mut self, context: &mut ScriptContext) {
    context.subscriptions::<MyMessage>();
}
Defensive patterns

Strategy: validation

Validate before calling

// before sending
let will_receive = engine.has_script_subscribers::<MyMessage>();
if !will_receive { log::warn!("no receivers for MyMessage; check subscriptions"); }

Prevention

When it happens

Trigger: Calling script message dispatch (Engine::dispatch_messages, e.g. during handle_scripts or a ScriptMessageSender::send flow) with a message payload type for which no script registered via subscribe_to (on start or ScriptDeinitContext subscriptions).

Common situations: Typo or mismatch in the message type name; script that should receive the message was never instantiated or was removed; subscribing in the wrong lifecycle hook so registration never happened before dispatch.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/58075a535aac20cd. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-impl/src/engine/mod.rs:466

        resource_manager: &ResourceManager,
        dt: f32,
        elapsed_time: f32,
        message_sender: &ScriptMessageSender,
        user_interfaces: &mut UiContainer,
        graphics_context: &mut GraphicsContext,
        task_pool: &mut TaskPoolHandler,
        input_state: &InputState,
        error_queue: &mut ErrorQueue,
    ) {
        while let Ok(message) = self.message_receiver.try_recv() {
            let type_id = match message.payload.get_dynamic_type_id() {
                Some(it) => MessageTypeId::Dynamic(it),
                None => MessageTypeId::Static(message.payload.deref().type_id()),
            };
            let receivers = self.type_groups.get(&type_id);

            if receivers.is_none_or(|r| r.is_empty()) {
                Log::warn(format!(
                    "Script message {message:?} was sent, but there's no receivers. \
                    Did you forgot to subscribe your script to the message?"
                ));
            }

            if let Some(receivers) = receivers {
                let mut payload = message.payload;

                match message.kind {
                    ScriptMessageKind::Targeted(target) => {
                        if receivers.contains(&target) {
                            let mut context = ScriptMessageContext {
                                dt,
                                elapsed_time,
                                plugins: PluginsRefMut(plugins),
                                handle: target,
                                scene,
                                scene_handle,

View on GitHub (pinned to 76c91aad8e)