{"record":{"id":"ace3eed1ad0c2418","repo":"vercel/next.js","slug":"specified-images-loader-property-images-loader","errorCode":null,"errorMessage":"Specified images.loader property (${images.loader}) also requires images.path property to be assigned to a URL prefix.\nSee more info here: https://nextjs.org/docs/api-reference/next/legacy/image#loader-configuration","messagePattern":"Specified images\\.loader property \\((.+?)\\) also requires images\\.path property to be assigned to a URL prefix\\.\nSee more info here: https://nextjs\\.org/docs/api-reference/next/legacy/image#loader-configuration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":767,"sourceCode":"\n    if (images.domains) {\n      if (!Array.isArray(images.domains)) {\n        throw new Error(\n          `Specified images.domains should be an Array received ${typeof images.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n        )\n      }\n    }\n\n    if (!images.loader) {\n      images.loader = 'default'\n    }\n\n    if (\n      images.loader !== 'default' &&\n      images.loader !== 'custom' &&\n      images.path === imageConfigDefault.path\n    ) {\n      throw new Error(\n        `Specified images.loader property (${images.loader}) also requires images.path property to be assigned to a URL prefix.\\nSee more info here: https://nextjs.org/docs/api-reference/next/legacy/image#loader-configuration`\n      )\n    }\n\n    if (\n      images.path === imageConfigDefault.path &&\n      result.basePath &&\n      !pathHasPrefix(images.path, result.basePath)\n    ) {\n      images.path = `${result.basePath}${images.path}`\n    }\n\n    // Append trailing slash for non-default loaders and when trailingSlash is set\n    if (\n      images.path &&\n      !images.path.endsWith('/') &&\n      (images.loader !== 'default' || result.trailingSlash)\n    ) {","sourceCodeStart":749,"sourceCodeEnd":785,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L749-L785","documentation":"Built-in non-default image loaders (cloudinary, akamai, aws, imgix, sanity) need a `path` URL prefix so the loader knows where to rewrite image src URLs. The check at config.ts:762-770 throws only when loader is neither 'default' nor 'custom' AND images.path still equals the default `/_next/image`. Without a custom path, the chosen external service cannot receive requests.","triggerScenarios":"Setting `images: { loader: 'cloudinary' }` (or 'akamai', 'imgix', 'sanity') without a `path` property. The guard fires specifically when path is left at its default value.","commonSituations":"Following a partial tutorial that sets the loader but skips the path. Switching loaders and forgetting to update path. Assuming the default local `/_next/image` path works for an external loader.","solutions":["Add the loader-specific path, e.g. cloudinary: `images: { loader: 'cloudinary', path: 'https://res.cloudinary.com/<account>/image/upload/' }`.","If you want a fully custom loader file, set `loader: 'custom'` plus `loaderFile`, which bypasses this check.","If you want local optimization, set `loader: 'default'` and remove the path override."],"exampleFix":"// before\nmodule.exports = { images: { loader: 'cloudinary' } }\n// after\nmodule.exports = { images: { loader: 'cloudinary', path: 'https://res.cloudinary.com/my-account/image/upload/' } }","handlingStrategy":"validation","validationCode":"const namedLoaders = ['cloudinary', 'akamai', 'aws', 'imgix', 'sanity'];\nconst { loader, path } = config.images ?? {};\nif (loader && namedLoaders.includes(loader) && (path == null || path === '/_next/image')) {\n  throw new Error(`loader ${loader} requires images.path`);\n}","typeGuard":"function loaderHasRequiredPath(images: any): boolean {\n  const named = ['cloudinary', 'akamai', 'aws', 'imgix', 'sanity'];\n  return !(named.includes(images?.loader) && (images?.path == null || images.path === '/_next/image'));\n}","tryCatchPattern":null,"preventionTips":["Whenever you set a named loader, immediately also set the corresponding path.","Keep a lookup table of loader -> default path template in your config generator."],"tags":["config","images","loader","next-config"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}