medusajs/medusa · warning

Unsupported gradient type: ${values.type}

Error message

Unsupported gradient type: ${values.type}

What it means

While converting Figma design tokens to CSS variables, the tokens command handles gradient values per type. A gradient whose values.type is not a supported gradient type (e.g. only linear is handled) reaches the else branch: the token is skipped with this warning and contributes no color/component output.

Source

Thrown at packages/design-system/toolbox/src/commands/tokens/command.ts:249

        if (values.type === PaintType.GRADIENT_LINEAR) {
          const toVariable = `--${gradientIdentifier}-to`
          const fromVariable = `--${gradientIdentifier}-from`

          const component = createLinearGradientComponent({
            ...values,
            to: toVariable,
            from: fromVariable,
          })

          if (component) {
            acc["colors"][lowerCaseTheme][fromVariable] = values.from
            acc["colors"][lowerCaseTheme][toVariable] = values.to

            acc["components"][lowerCaseTheme][`.${gradientIdentifier}`] =
              component
          }
        } else {
          logger.warn(`Unsupported gradient type: ${values.type}`)
        }
      }
    }

    return acc
  }, themeNode)

  Object.values(effectStyles.nodes).reduce((acc, curr) => {
    if (!curr) {
      return acc
    }

    const [theme, type, variable] = curr.document.name.split("/")

    if (!type || !variable) {
      return acc
    }

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Change the Figma style to a linear gradient (the only supported type)
  2. Or extend the token transformer to handle the new gradient type (map values.type to a CSS equivalent)
  3. Exclude the unsupported style from the Figma token set so it doesn't reach the transformer
Defensive patterns

Strategy: type-guard

Validate before calling

if (values.type !== "linear") {
  logger.warn(`Unsupported gradient type: ${values.type}`)
  return acc // skip
}

Type guard

const isSupportedGradient = (t: string): boolean => t === "linear"

Prevention

When it happens

Trigger: A Figma color style using a radial/angular/diamond gradient (values.type other than the supported linear type) while running design-token generation.

Common situations: Designers introduce radial or angular gradient styles in the Figma library after the token pipeline was built; importing a new Figma file that uses unsupported gradient styles.

Related errors


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