{"record":{"id":"d2ffd9537511f444","repo":"vercel/next.js","slug":"image-with-src-src-has-both-preload-and-lo","errorCode":null,"errorMessage":"Image with src \"${src}\" has both \"preload\" and \"loading='lazy'\" properties. Only one should be used.","messagePattern":"Image with src \"(.+?)\" has both \"preload\" 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":553,"sourceCode":"            `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    ) {\n      throw new Error(\n        `Image with src \"${src}\" has invalid \"placeholder\" property \"${placeholder}\".`\n      )\n    }\n    if (placeholder !== 'empty') {","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/shared/lib/get-img-props.ts#L535-L571","documentation":"Warning emitted by getImgProps when the caller sets both preload behavior (via the priority prop) and loading=\"lazy\" on the same next/image. These two settings are contradictory — priority implies eager preloading of the image while lazy explicitly defers loading — so the component asks the author to keep only one. It is a developer-facing warning, not a build failure.","triggerScenarios":"next/image receives both preload and loading='lazy'.","commonSituations":"Setting preload together with loading='lazy'; only one should be used.","solutions":["Remove loading='lazy' when preload is set."],"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"}