medusajs/medusa · warning

The injection zone "${zone}" is not a core injection zone. C

Error message

The injection zone "${zone}" is not a core injection zone. Custom zones are not validated, verify it is correct.

What it means

isValidInjectionZone validates a widget's injection zone for the Medusa admin widget system. Core zones (from the INJECTION_ZONES list) validate silently; any other string logs this warning and still returns true, because custom zones are permitted but cannot be validated against the known list. It is advisory, not a failure.

Source

Thrown at packages/admin/admin-shared/src/extensions/widgets/utils.ts:10

import { INJECTION_ZONES } from "./constants"
import { InjectionZone } from "./types"

/**
 * Validates that the provided zone is a valid injection zone for a widget.
 */
export function isValidInjectionZone(zone: any): zone is InjectionZone {
  if (typeof zone !== "string") return false
  if (INJECTION_ZONES.includes(zone as any)) return true
  console.warn(
    `The injection zone "${zone}" is not a core injection zone. Custom zones are not validated, verify it is correct.`
  )
  return true
}

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Check the zone against the official InjectionZone list (via the admin(-shared) types or docs) — a typo'd core zone will silently never render
  2. If the custom zone is intentional (a plugin-defined zone), verify with that plugin's documentation that the string is correct
  3. Silence concern by asserting the zone with the InjectionZone type in TypeScript

Example fix

// before
export const config: WidgetConfig = { zone: "orders.details.side.after" } // typo'd

// after
import { InjectionZone } from "@medusajs/admin-shared"
export const config: WidgetConfig = { zone: "order.details.side.after" }
Defensive patterns

Strategy: type-guard

Validate before calling

null

Type guard

import { isValidInjectionZone } from "@medusajs/admin-shared"
const zone: string = config.zone
if (!isValidInjectionZone(zone)) {
  throw new Error(`Invalid injection zone: ${zone}`)
}

Try / catch

null

Prevention

When it happens

Trigger: Registering an admin widget whose zone is a non-core string (e.g. "brandDetailCustom" instead of "brand.details.side.after") or a typo of a core zone; the function warns and passes.

Common situations: Typos like "order.details.before" vs the actual core zone name; using custom injection zones introduced by other plugins; copy-pasting a zone from an outdated example.

Related errors


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