medusajs/medusa · error

The subscriber in ${path} is missing an event in the config.

Error message

The subscriber in ${path} is missing an event in the config. skipped.

What it means

SubscriberConfig.event tells the loader which event(s) to subscribe to. When config exists but has no `event` property, the loader refuses the file. In development this is a warning and the subscriber is skipped; in production (configManager.isProduction) the loader instead THROWS 'The subscriber in ${path} is missing an event in the config', blocking startup.

Source

Thrown at packages/core/framework/src/subscribers/subscriberLoader.ts:111

    if (!config.event) {
      /**
       * If the subscriber is missing an event, we can't use it.
       * In production we throw an error, else we log a warning
       */
      if (configManager.isProduction) {
        throw new Error(
          `The subscriber in ${path} is missing an event in the config.`
        )
      } else {
        this.logger.warn(
          `The subscriber in ${path} is missing an event in the config. skipped.`
        )
      }

      return false
    }

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Set event in the config: export const config = { event: "product.updated" } or an array: { event: ["product.created", "product.updated"] }
  2. Run a local production-mode boot (NODE_ENV=production) before deploying so this surfaces as a hard error in CI rather than on the server

Example fix

// before
export const config = { context: { subscriberId: "product-handler" } }

// after
export const config = {
  event: "product.updated",
  context: { subscriberId: "product-handler" },
}
Defensive patterns

Strategy: validation

Validate before calling

export const config: SubscriberConfig = {
  event: process.env.SUB_EVENT ?? "product.updated", // always a string
}

Type guard

const hasValidEvent = (c: any): c is { event: string | string[] } =>
  !!c?.event &&
  (typeof c.event === "string" ||
    (Array.isArray(c.event) && c.event.every((e) => typeof e === "string")))

Prevention

When it happens

Trigger: export const config = { context: {...} } with no event key, or event set to undefined/null via a computed value.

Common situations: Refactoring a subscriber to listen to multiple events and accidentally deleting the event field; conditional event assignments that evaluate to undefined; passing NODE_ENV=production with a half-finished subscriber file causing deploy-time boot failure.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/c9c2be1ae2f8c30b. Report an issue: GitHub.