{"record":{"id":"e7552e75cce05463","repo":"vercel/next.js","slug":"specified-images-loaderfile-does-not-exist-at-a","errorCode":null,"errorMessage":"Specified images.loaderFile does not exist at \"${absolutePath}\".","messagePattern":"Specified images\\.loaderFile does not exist at \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":867,"sourceCode":"\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    ) {\n      images.path += '/'\n    }\n\n    if (images.loaderFile) {\n      if (images.loader !== 'default' && images.loader !== 'custom') {\n        throw new Error(\n          `Specified images.loader property (${images.loader}) cannot be used with images.loaderFile property. Please set images.loader to \"custom\".`\n        )\n      }\n      const absolutePath = join(dir, images.loaderFile)\n      if (!existsSync(absolutePath)) {\n        throw new Error(\n          `Specified images.loaderFile does not exist at \"${absolutePath}\".`\n        )\n      }\n      images.loaderFile = absolutePath\n    }\n  }\n\n  warnCustomizedOption(\n    result,\n    'experimental.esmExternals',\n    true,\n    'experimental.esmExternals is not recommended to be modified as it may disrupt module resolution',\n    configFileName,\n    silent\n  )\n\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/packages/next/src/server/config.ts#L849-L885","documentation":"Images config validation in assignDefaultsAndValidate: images.loaderFile is set, and after resolving it against the project dir the file does not exist on disk at the computed absolutePath. A custom loader module that cannot be loaded would break the image optimizer at runtime, so validation fails at config load time.","triggerScenarios":"images.loaderFile points to a file that does not exist.","commonSituations":"A wrong path in images.loaderFile in next.config.","solutions":["Point images.loaderFile at an existing file path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"34433fd12ee8074ea3f47af9f36255c7390d0301","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}