{"record":{"id":"3c53ad8350dd70ba","repo":"medusajs/medusa","slug":"the-subscriber-in-path-has-an-invalid-event-con","errorCode":null,"errorMessage":"The subscriber in ${path} has an invalid event config. The event must be a string or an array of strings. skipped.","messagePattern":"The subscriber in (.+?) has an invalid event config\\. The event must be a string or an array of strings\\. skipped\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/framework/src/subscribers/subscriberLoader.ts","lineNumber":125,"sourceCode":"    const events = Array.isArray(config.event) ? config.event : [config.event]\n\n    if (events.some((e: unknown) => !(typeof e === \"string\"))) {\n      /**\n       * If the subscribers event is not a string or an array of strings, we can't use it\n       */\n      this.logger.warn(\n        `The subscriber in ${path} has an invalid event config. The event must be a string or an array of strings. skipped.`\n      )\n      return false\n    }","sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/framework/src/subscribers/subscriberLoader.ts#L125","documentation":"After checking config.event exists, validateSubscriber normalizes it (wrapping a single value into an array) and verifies every entry is a string. If any entry is a non-string (symbol, object, number), the subscriber is skipped with this warning. Note TypeScript types catch this at compile time in .ts files, so it typically appears in .js subscribers or after `any` casts.","triggerScenarios":"export const config = { event: [SomeEnum.VALUE, 123] } where entries are not strings, or event built from an object/undefined element at runtime in a .js subscriber.","commonSituations":"Passing a variable that is not a string (e.g. a symbol constant or a config object) into event; mixing `as any` casts that defeat type checking; dynamically built event arrays containing nulls.","solutions":["Make event a string or a plain array of strings: { event: [\"cart.created\", \"cart.updated\"] }","Type the export explicitly (export const config: SubscriberConfig = ...) so the compiler rejects non-string events","Remove null/undefined entries from dynamically-built event arrays"],"exampleFix":"// before\nexport const config = { event: [getEventName(), undefined] }\n\n// after\nexport const config: SubscriberConfig = {\n  event: [\"order.placed\", \"order.canceled\"],\n}","handlingStrategy":"type-guard","validationCode":"const events = Array.isArray(config.event) ? config.event : [config.event]\nif (events.some((e) => typeof e !== \"string\")) throw new Error(\"bad events\")","typeGuard":"const isEventConfig = (e: unknown): e is string | string[] =>\n  typeof e === \"string\" || (Array.isArray(e) && e.every((x) => typeof x === \"string\"))","tryCatchPattern":null,"preventionTips":["Type config as SubscriberConfig","Avoid as any casts on subscriber config","Filter undefined out of dynamic event arrays"],"tags":["subscribers","event-bus","type-validation","config"],"backgroundTag":"schema-validation-failed","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}