medusajs/medusa · warning

The gradient type "${gradient.type}" is not supported.

Error message

The gradient type "${gradient.type}" is not supported.

What it means

gradientValues maps a Figma PaintGradient to CSS values. It explicitly handles GRADIENT_LINEAR and for every other gradient paint type (radial, angular, diamond, striped) logs this warning and returns null, so the caller drops that gradient from generated tokens/components.

Source

Thrown at packages/design-system/toolbox/src/commands/tokens/utils/colors.ts:147

  opacity,
}: CreateLinearGradientComponentProps): CSSProperties {
  return {
    backgroundImage: `linear-gradient(${degree}deg, var(${from}), var(${to}))`,
    opacity: `${opacity}%`,
  }
}

/**
 * Get the values of a gradient based on its type.
 * @param gradient
 * @returns
 */
function gradientValues(gradient: PaintGradient) {
  if (gradient.type === PaintType.GRADIENT_LINEAR) {
    return linearGradientValues(gradient)
  }

  logger.warn(`The gradient type "${gradient.type}" is not supported.`)
  return null
}

export { colorToRGBA, createLinearGradientComponent, gradientValues }

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Convert the Figma gradient to a linear gradient
  2. Add a case for the missing PaintType (radial etc.) returning proper CSS and re-export from utils
  3. Filter non-linear gradient styles out before running token generation

Example fix

// extending the utility
function gradientValues(gradient: PaintGradient) {
  if (gradient.type === PaintType.GRADIENT_LINEAR) return linearGradientValues(gradient)
  if (gradient.type === PaintType.GRADIENT_RADIAL) return radialGradientValues(gradient)
  logger.warn(`The gradient type "${gradient.type}" is not supported.`)
  return null
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (gradient.type !== PaintType.GRADIENT_LINEAR) return null // skip before processing

Type guard

const isLinearGradient = (g: PaintGradient): boolean =>
  g.type === PaintType.GRADIENT_LINEAR

Prevention

When it happens

Trigger: Processing a PaintGradient with type !== GRADIENT_LINEAR (e.g. GRADIENT_RADIAL) via the colors token utility during token generation.

Common situations: Same family as the tokens-command warning: designers adding non-linear gradients to the design system's Figma file; this is the lower-level utility that surfaces it.

Related errors


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