{"record":{"id":"32c4ed452c30e2f4","repo":"vercel/next.js","slug":"image-with-src-src-has-both-priority-and-l","errorCode":null,"errorMessage":"Image with src \"${src}\" has both \"priority\" and \"loading='lazy'\" properties. Only one should be used.","messagePattern":"Image with src \"(.+?)\" has both \"priority\" and \"loading='lazy'\" properties\\. Only one should be used\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/shared/lib/get-img-props.ts","lineNumber":548,"sourceCode":"          )\n        }\n        // eslint-disable-next-line no-control-regex\n        if (/[\\x00-\\x20]$/.test(src)) {\n          throw new Error(\n            `Image with src \"${src}\" cannot end with a space or control character. Use src.trimEnd() to remove it or encodeURIComponent(src) to keep it.`\n          )\n        }\n      }\n    }\n    if (!VALID_LOADING_VALUES.includes(loading)) {\n      throw new Error(\n        `Image with src \"${src}\" has invalid \"loading\" property. Provided \"${loading}\" should be one of ${VALID_LOADING_VALUES.map(\n          String\n        ).join(',')}.`\n      )\n    }\n    if (priority && loading === 'lazy') {\n      throw new Error(\n        `Image with src \"${src}\" has both \"priority\" and \"loading='lazy'\" properties. Only one should be used.`\n      )\n    }\n    if (preload && loading === 'lazy') {\n      throw new Error(\n        `Image with src \"${src}\" has both \"preload\" and \"loading='lazy'\" properties. Only one should be used.`\n      )\n    }\n    if (preload && priority) {\n      throw new Error(\n        `Image with src \"${src}\" has both \"preload\" and \"priority\" properties. Only \"preload\" should be used.`\n      )\n    }\n    if (\n      placeholder !== 'empty' &&\n      placeholder !== 'blur' &&\n      !placeholder.startsWith('data:image/')\n    ) {","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/shared/lib/get-img-props.ts#L530-L566","documentation":"Props validation in getImgProps: priority was combined with loading=\"lazy\". Priority preloads the image as an eager high-priority fetch, which directly contradicts lazy loading; exactly one intent must be chosen.","triggerScenarios":"next/image receives both priority and loading='lazy'.","commonSituations":"Setting priority together with loading='lazy'; only one should be used.","solutions":["Remove loading='lazy' when priority is set (or remove priority)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}