vercel/next.js · error · Error

Image with src "${src}" has both "preload" and "priority" pr

Error message

Image with src "${src}" has both "preload" and "priority" properties. Only "preload" should be used.

What it means

Props validation in getImgProps: both preload and priority were passed. priority is the legacy name subsumed by preload, so passing both is ambiguous; the newer preload wins and priority must be removed.

Source

Thrown at packages/next/src/shared/lib/get-img-props.ts:558

    if (!VALID_LOADING_VALUES.includes(loading)) {
      throw new Error(
        `Image with src "${src}" has invalid "loading" property. Provided "${loading}" should be one of ${VALID_LOADING_VALUES.map(
          String
        ).join(',')}.`
      )
    }
    if (priority && loading === 'lazy') {
      throw new Error(
        `Image with src "${src}" has both "priority" and "loading='lazy'" properties. Only one should be used.`
      )
    }
    if (preload && loading === 'lazy') {
      throw new Error(
        `Image with src "${src}" has both "preload" and "loading='lazy'" properties. Only one should be used.`
      )
    }
    if (preload && priority) {
      throw new Error(
        `Image with src "${src}" has both "preload" and "priority" properties. Only "preload" should be used.`
      )
    }
    if (
      placeholder !== 'empty' &&
      placeholder !== 'blur' &&
      !placeholder.startsWith('data:image/')
    ) {
      throw new Error(
        `Image with src "${src}" has invalid "placeholder" property "${placeholder}".`
      )
    }
    if (placeholder !== 'empty') {
      if (widthInt && heightInt && widthInt * heightInt < 1600) {
        warnOnce(
          `Image with src "${src}" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.`
        )
      }

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Use preload only; remove the priority prop.
Defensive patterns

Strategy: validation

When it happens

Trigger: next/image receives both preload and priority.

Common situations: Setting both preload and priority; only preload should be used.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/e48ca729f75ca40e. Report an issue: GitHub.