next 15.4.2-canary.39 → 15.4.2-canary.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack-config.js +2 -2
  5. package/dist/client/app-bootstrap.js +1 -1
  6. package/dist/client/index.js +1 -1
  7. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  8. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  9. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  10. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  11. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  12. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  13. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  14. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  15. package/dist/esm/build/index.js +2 -2
  16. package/dist/esm/build/swc/index.js +1 -1
  17. package/dist/esm/build/webpack-config.js +2 -2
  18. package/dist/esm/client/app-bootstrap.js +1 -1
  19. package/dist/esm/client/index.js +1 -1
  20. package/dist/esm/server/config-schema.js +1 -0
  21. package/dist/esm/server/config-schema.js.map +1 -1
  22. package/dist/esm/server/config-shared.js +1 -0
  23. package/dist/esm/server/config-shared.js.map +1 -1
  24. package/dist/esm/server/config.js +8 -0
  25. package/dist/esm/server/config.js.map +1 -1
  26. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  27. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  28. package/dist/esm/server/image-optimizer.js +7 -4
  29. package/dist/esm/server/image-optimizer.js.map +1 -1
  30. package/dist/esm/server/lib/app-info-log.js +1 -1
  31. package/dist/esm/server/lib/start-server.js +1 -1
  32. package/dist/esm/shared/lib/canary-only.js +1 -1
  33. package/dist/server/config-schema.js +1 -0
  34. package/dist/server/config-schema.js.map +1 -1
  35. package/dist/server/config-shared.d.ts +7 -1
  36. package/dist/server/config-shared.js +1 -0
  37. package/dist/server/config-shared.js.map +1 -1
  38. package/dist/server/config.js +8 -0
  39. package/dist/server/config.js.map +1 -1
  40. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  41. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  42. package/dist/server/image-optimizer.d.ts +2 -2
  43. package/dist/server/image-optimizer.js +7 -4
  44. package/dist/server/image-optimizer.js.map +1 -1
  45. package/dist/server/lib/app-info-log.js +1 -1
  46. package/dist/server/lib/start-server.js +1 -1
  47. package/dist/shared/lib/canary-only.js +1 -1
  48. package/dist/telemetry/anonymous-meta.js +1 -1
  49. package/dist/telemetry/events/session-stopped.js +2 -2
  50. package/dist/telemetry/events/version.js +2 -2
  51. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/server/config.ts"],"sourcesContent":["import { existsSync } from 'fs'\nimport { basename, extname, join, relative, isAbsolute, resolve } from 'path'\nimport { pathToFileURL } from 'url'\nimport findUp from 'next/dist/compiled/find-up'\nimport * as Log from '../build/output/log'\nimport * as ciEnvironment from '../server/ci-info'\nimport {\n CONFIG_FILES,\n PHASE_DEVELOPMENT_SERVER,\n PHASE_EXPORT,\n PHASE_PRODUCTION_BUILD,\n PHASE_PRODUCTION_SERVER,\n} from '../shared/lib/constants'\nimport { defaultConfig, normalizeConfig } from './config-shared'\nimport type {\n ExperimentalConfig,\n NextConfigComplete,\n NextConfig,\n TurbopackLoaderItem,\n NextAdapter,\n} from './config-shared'\n\nimport { loadWebpackHook } from './config-utils'\nimport { imageConfigDefault } from '../shared/lib/image-config'\nimport type { ImageConfig } from '../shared/lib/image-config'\nimport { loadEnvConfig, updateInitialEnv } from '@next/env'\nimport { flushAndExit } from '../telemetry/flush-and-exit'\nimport { findRootDir } from '../lib/find-root'\nimport { setHttpClientAndAgentOptions } from './setup-http-agent-env'\nimport { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\nimport { matchRemotePattern } from '../shared/lib/match-remote-pattern'\n\nimport type { ZodError } from 'next/dist/compiled/zod'\nimport { hasNextSupport } from '../server/ci-info'\nimport { transpileConfig } from '../build/next-config-ts/transpile-config'\nimport { dset } from '../shared/lib/dset'\nimport { normalizeZodErrors } from '../shared/lib/zod'\nimport { HTML_LIMITED_BOT_UA_RE_STRING } from '../shared/lib/router/utils/is-bot'\nimport { findDir } from '../lib/find-pages-dir'\nimport { CanaryOnlyError, isStableBuild } from '../shared/lib/canary-only'\nimport { interopDefault } from '../lib/interop-default'\nimport { djb2Hash } from '../shared/lib/hash'\n\nexport { normalizeConfig } from './config-shared'\nexport type { DomainLocale, NextConfig } from './config-shared'\n\nfunction normalizeNextConfigZodErrors(\n error: ZodError<NextConfig>\n): [errorMessages: string[], shouldExit: boolean] {\n let shouldExit = false\n const issues = normalizeZodErrors(error)\n return [\n issues.flatMap(({ issue, message }) => {\n if (issue.path[0] === 'images') {\n // We exit the build when encountering an error in the images config\n shouldExit = true\n }\n\n return message\n }),\n shouldExit,\n ]\n}\n\nexport function warnOptionHasBeenDeprecated(\n config: NextConfig,\n nestedPropertyKey: string,\n reason: string,\n silent: boolean\n): boolean {\n let hasWarned = false\n if (!silent) {\n let current = config\n let found = true\n const nestedPropertyKeys = nestedPropertyKey.split('.')\n for (const key of nestedPropertyKeys) {\n if (current[key] !== undefined) {\n current = current[key]\n } else {\n found = false\n break\n }\n }\n if (found) {\n Log.warnOnce(reason)\n hasWarned = true\n }\n }\n return hasWarned\n}\n\nexport function warnOptionHasBeenMovedOutOfExperimental(\n config: NextConfig,\n oldExperimentalKey: string,\n newKey: string,\n configFileName: string,\n silent: boolean\n) {\n if (config.experimental && oldExperimentalKey in config.experimental) {\n if (!silent) {\n Log.warn(\n `\\`experimental.${oldExperimentalKey}\\` has been moved to \\`${newKey}\\`. ` +\n `Please update your ${configFileName} file accordingly.`\n )\n }\n\n let current = config\n const newKeys = newKey.split('.')\n while (newKeys.length > 1) {\n const key = newKeys.shift()!\n current[key] = current[key] || {}\n current = current[key]\n }\n current[newKeys.shift()!] = (config.experimental as any)[oldExperimentalKey]\n }\n\n return config\n}\n\nfunction warnCustomizedOption(\n config: NextConfig,\n key: string,\n defaultValue: any,\n customMessage: string,\n configFileName: string,\n silent: boolean\n) {\n const segs = key.split('.')\n let current = config\n\n while (segs.length >= 1) {\n const seg = segs.shift()!\n if (!(seg in current)) {\n return\n }\n current = current[seg]\n }\n\n if (!silent && current !== defaultValue) {\n Log.warn(\n `The \"${key}\" option has been modified. ${customMessage ? customMessage + '. ' : ''}It should be removed from your ${configFileName}.`\n )\n }\n}\n\nfunction assignDefaults(\n dir: string,\n userConfig: NextConfig & { configFileName: string },\n silent: boolean\n): NextConfigComplete {\n const configFileName = userConfig.configFileName\n if (typeof userConfig.exportTrailingSlash !== 'undefined') {\n if (!silent) {\n Log.warn(\n `The \"exportTrailingSlash\" option has been renamed to \"trailingSlash\". Please update your ${configFileName}.`\n )\n }\n if (typeof userConfig.trailingSlash === 'undefined') {\n userConfig.trailingSlash = userConfig.exportTrailingSlash\n }\n delete userConfig.exportTrailingSlash\n }\n\n // Handle deprecation of experimental.dynamicIO and migrate to experimental.cacheComponents\n if (userConfig.experimental?.dynamicIO !== undefined) {\n warnOptionHasBeenDeprecated(\n userConfig,\n 'experimental.dynamicIO',\n `\\`experimental.dynamicIO\\` has been renamed to \\`experimental.cacheComponents\\`. Please update your ${configFileName} file accordingly.`,\n silent\n )\n\n // If cacheComponents was not explicitly set by the user (i.e., it's still the default value),\n // use the dynamicIO value. We check against the user config, not the merged result.\n if (userConfig.experimental?.cacheComponents === undefined) {\n userConfig.experimental.cacheComponents =\n userConfig.experimental.dynamicIO\n }\n\n // Remove the deprecated property\n delete userConfig.experimental.dynamicIO\n }\n\n const config = Object.keys(userConfig).reduce<{ [key: string]: any }>(\n (currentConfig, key) => {\n const value = userConfig[key]\n\n if (value === undefined || value === null) {\n return currentConfig\n }\n\n if (key === 'distDir') {\n if (typeof value !== 'string') {\n throw new Error(\n `Specified distDir is not a string, found type \"${typeof value}\"`\n )\n }\n const userDistDir = value.trim()\n\n // don't allow public as the distDir as this is a reserved folder for\n // public files\n if (userDistDir === 'public') {\n throw new Error(\n `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://nextjs.org/docs/messages/can-not-output-to-public`\n )\n }\n // make sure distDir isn't an empty string as it can result in the provided\n // directory being deleted in development mode\n if (userDistDir.length === 0) {\n throw new Error(\n `Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`\n )\n }\n }\n\n if (key === 'pageExtensions') {\n if (!Array.isArray(value)) {\n throw new Error(\n `Specified pageExtensions is not an array of strings, found \"${value}\". Please update this config or remove it.`\n )\n }\n\n if (!value.length) {\n throw new Error(\n `Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`\n )\n }\n\n value.forEach((ext) => {\n if (typeof ext !== 'string') {\n throw new Error(\n `Specified pageExtensions is not an array of strings, found \"${ext}\" of type \"${typeof ext}\". Please update this config or remove it.`\n )\n }\n })\n }\n\n const defaultValue = (defaultConfig as Record<string, unknown>)[key]\n\n if (\n !!value &&\n value.constructor === Object &&\n typeof defaultValue === 'object'\n ) {\n currentConfig[key] = {\n ...defaultValue,\n ...Object.keys(value).reduce<any>((c, k) => {\n const v = value[k]\n if (v !== undefined && v !== null) {\n c[k] = v\n }\n return c\n }, {}),\n }\n } else {\n currentConfig[key] = value\n }\n\n return currentConfig\n },\n {}\n ) as NextConfig & { configFileName: string }\n\n const result = {\n ...defaultConfig,\n ...config,\n experimental: {\n ...defaultConfig.experimental,\n ...config.experimental,\n },\n }\n\n // ensure correct default is set for api-resolver revalidate handling\n if (!result.experimental?.trustHostHeader && ciEnvironment.hasNextSupport) {\n result.experimental.trustHostHeader = true\n }\n\n if (\n result.experimental?.allowDevelopmentBuild &&\n process.env.NODE_ENV !== 'development'\n ) {\n throw new Error(\n `The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.`\n )\n }\n\n if (isStableBuild()) {\n // Prevents usage of certain experimental features outside of canary\n if (result.experimental?.ppr) {\n throw new CanaryOnlyError({ feature: 'experimental.ppr' })\n } else if (result.experimental?.cacheComponents) {\n throw new CanaryOnlyError({ feature: 'experimental.cacheComponents' })\n } else if (result.experimental?.turbopackPersistentCaching) {\n throw new CanaryOnlyError({\n feature: 'experimental.turbopackPersistentCaching',\n })\n }\n }\n\n if (result.output === 'export') {\n if (result.i18n) {\n throw new Error(\n 'Specified \"i18n\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-i18n'\n )\n }\n\n if (!hasNextSupport) {\n if (result.rewrites) {\n Log.warn(\n 'Specified \"rewrites\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n )\n }\n if (result.redirects) {\n Log.warn(\n 'Specified \"redirects\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n )\n }\n if (result.headers) {\n Log.warn(\n 'Specified \"headers\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n )\n }\n }\n }\n\n if (typeof result.assetPrefix !== 'string') {\n throw new Error(\n `Specified assetPrefix is not a string, found type \"${typeof result.assetPrefix}\" https://nextjs.org/docs/messages/invalid-assetprefix`\n )\n }\n\n if (typeof result.basePath !== 'string') {\n throw new Error(\n `Specified basePath is not a string, found type \"${typeof result.basePath}\"`\n )\n }\n\n if (result.basePath !== '') {\n if (result.basePath === '/') {\n throw new Error(\n `Specified basePath /. basePath has to be either an empty string or a path prefix\"`\n )\n }\n\n if (!result.basePath.startsWith('/')) {\n throw new Error(\n `Specified basePath has to start with a /, found \"${result.basePath}\"`\n )\n }\n\n if (result.basePath !== '/') {\n if (result.basePath.endsWith('/')) {\n throw new Error(\n `Specified basePath should not end with /, found \"${result.basePath}\"`\n )\n }\n\n if (result.assetPrefix === '') {\n result.assetPrefix = result.basePath\n }\n\n if (result.amp?.canonicalBase === '') {\n result.amp.canonicalBase = result.basePath\n }\n }\n }\n\n if (result?.images) {\n const images: ImageConfig = result.images\n\n if (typeof images !== 'object') {\n throw new Error(\n `Specified images should be an object received ${typeof images}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n if (images.localPatterns) {\n if (!Array.isArray(images.localPatterns)) {\n throw new Error(\n `Specified images.localPatterns should be an Array received ${typeof images.localPatterns}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n // avoid double-pushing the same pattern if it already exists\n const hasMatch = images.localPatterns.some(\n (pattern) =>\n pattern.pathname === '/_next/static/media/**' && pattern.search === ''\n )\n if (!hasMatch) {\n // static import images are automatically allowed\n images.localPatterns.push({\n pathname: '/_next/static/media/**',\n search: '',\n })\n }\n }\n\n if (images.remotePatterns) {\n if (!Array.isArray(images.remotePatterns)) {\n throw new Error(\n `Specified images.remotePatterns should be an Array received ${typeof images.remotePatterns}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n // We must convert URL to RemotePattern since URL has a colon in the protocol\n // and also has additional properties we want to filter out. Also, new URL()\n // accepts any protocol so we need manual validation here.\n images.remotePatterns = images.remotePatterns.map(\n ({ protocol, hostname, port, pathname, search }) => {\n const proto = protocol?.replace(/:$/, '')\n if (!['http', 'https', undefined].includes(proto)) {\n throw new Error(\n `Specified images.remotePatterns must have protocol \"http\" or \"https\" received \"${proto}\".`\n )\n }\n return {\n protocol: proto as 'http' | 'https' | undefined,\n hostname,\n port,\n pathname,\n search,\n }\n }\n )\n\n // static images are automatically prefixed with assetPrefix\n // so we need to ensure _next/image allows downloading from\n // this resource\n if (config.assetPrefix?.startsWith('http')) {\n try {\n const url = new URL(config.assetPrefix)\n const hasMatchForAssetPrefix = images.remotePatterns.some((pattern) =>\n matchRemotePattern(pattern, url)\n )\n\n // avoid double-pushing the same pattern if it already can be matched\n if (!hasMatchForAssetPrefix) {\n images.remotePatterns.push({\n hostname: url.hostname,\n protocol: url.protocol.replace(/:$/, '') as 'http' | 'https',\n port: url.port,\n })\n }\n } catch (error) {\n throw new Error(\n `Invalid assetPrefix provided. Original error: ${error}`\n )\n }\n }\n }\n\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 ) {\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 warnOptionHasBeenDeprecated(\n result,\n 'experimental.instrumentationHook',\n `\\`experimental.instrumentationHook\\` is no longer needed, because \\`instrumentation.js\\` is available by default. You can remove it from ${configFileName}.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'experimental.after',\n `\\`experimental.after\\` is no longer needed, because \\`after\\` is available by default. You can remove it from ${configFileName}.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'devIndicators.appIsrStatus',\n `\\`devIndicators.appIsrStatus\\` is deprecated and no longer configurable. Please remove it from ${configFileName}.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'devIndicators.buildActivity',\n `\\`devIndicators.buildActivity\\` is deprecated and no longer configurable. Please remove it from ${configFileName}.`,\n silent\n )\n\n const hasWarnedBuildActivityPosition = warnOptionHasBeenDeprecated(\n result,\n 'devIndicators.buildActivityPosition',\n `\\`devIndicators.buildActivityPosition\\` has been renamed to \\`devIndicators.position\\`. Please update your ${configFileName} file accordingly.`,\n silent\n )\n if (\n hasWarnedBuildActivityPosition &&\n result.devIndicators !== false &&\n 'buildActivityPosition' in result.devIndicators &&\n result.devIndicators.buildActivityPosition !== result.devIndicators.position\n ) {\n Log.warnOnce(\n `The \\`devIndicators\\` option \\`buildActivityPosition\\` (\"${result.devIndicators.buildActivityPosition}\") conflicts with \\`position\\` (\"${result.devIndicators.position}\"). Using \\`buildActivityPosition\\` (\"${result.devIndicators.buildActivityPosition}\") for backward compatibility.`\n )\n result.devIndicators.position = result.devIndicators.buildActivityPosition\n }\n\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'bundlePagesExternals',\n 'bundlePagesRouterDependencies',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'serverComponentsExternalPackages',\n 'serverExternalPackages',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'relay',\n 'compiler.relay',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'styledComponents',\n 'compiler.styledComponents',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'emotion',\n 'compiler.emotion',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'reactRemoveProperties',\n 'compiler.reactRemoveProperties',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'removeConsole',\n 'compiler.removeConsole',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'swrDelta',\n 'expireTime',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'outputFileTracingRoot',\n 'outputFileTracingRoot',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'outputFileTracingIncludes',\n 'outputFileTracingIncludes',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'outputFileTracingExcludes',\n 'outputFileTracingExcludes',\n configFileName,\n silent\n )\n\n if ((result.experimental as any).outputStandalone) {\n if (!silent) {\n Log.warn(\n `experimental.outputStandalone has been renamed to \"output: 'standalone'\", please move the config.`\n )\n }\n result.output = 'standalone'\n }\n\n if (\n typeof result.experimental?.serverActions?.bodySizeLimit !== 'undefined'\n ) {\n const value = parseInt(\n result.experimental.serverActions?.bodySizeLimit.toString()\n )\n if (isNaN(value) || value < 1) {\n throw new Error(\n 'Server Actions Size Limit must be a valid number or filesize format larger than 1MB: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit'\n )\n }\n }\n\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'transpilePackages',\n 'transpilePackages',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'skipMiddlewareUrlNormalize',\n 'skipMiddlewareUrlNormalize',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'skipTrailingSlashRedirect',\n 'skipTrailingSlashRedirect',\n configFileName,\n silent\n )\n\n if (\n result?.outputFileTracingRoot &&\n !isAbsolute(result.outputFileTracingRoot)\n ) {\n result.outputFileTracingRoot = resolve(result.outputFileTracingRoot)\n if (!silent) {\n Log.warn(\n `outputFileTracingRoot should be absolute, using: ${result.outputFileTracingRoot}`\n )\n }\n }\n\n if (result?.turbopack?.root && !isAbsolute(result.turbopack.root)) {\n result.turbopack.root = resolve(result.turbopack.root)\n if (!silent) {\n Log.warn(\n `turbopack.root should be absolute, using: ${result.turbopack.root}`\n )\n }\n }\n\n // only leverage deploymentId\n if (process.env.NEXT_DEPLOYMENT_ID) {\n result.deploymentId = process.env.NEXT_DEPLOYMENT_ID\n }\n\n if (result?.outputFileTracingRoot && !result?.turbopack?.root) {\n dset(result, ['turbopack', 'root'], result.outputFileTracingRoot)\n }\n\n // use the highest level lockfile as tracing root\n if (!result?.outputFileTracingRoot && !result?.turbopack?.root) {\n let rootDir = findRootDir(dir)\n\n if (rootDir) {\n result.outputFileTracingRoot = rootDir\n dset(result, ['turbopack', 'root'], rootDir)\n }\n }\n\n setHttpClientAndAgentOptions(result || defaultConfig)\n\n if (result.i18n) {\n const hasAppDir = Boolean(findDir(dir, 'app'))\n\n if (hasAppDir) {\n warnOptionHasBeenDeprecated(\n result,\n 'i18n',\n `i18n configuration in ${configFileName} is unsupported in App Router.\\nLearn more about internationalization in App Router: https://nextjs.org/docs/app/building-your-application/routing/internationalization`,\n silent\n )\n }\n\n const { i18n } = result\n const i18nType = typeof i18n\n\n if (i18nType !== 'object') {\n throw new Error(\n `Specified i18n should be an object received ${i18nType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (!Array.isArray(i18n.locales)) {\n throw new Error(\n `Specified i18n.locales should be an Array received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (i18n.locales.length > 100 && !silent) {\n Log.warn(\n `Received ${i18n.locales.length} i18n.locales items which exceeds the recommended max of 100.\\nSee more info here: https://nextjs.org/docs/advanced-features/i18n-routing#how-does-this-work-with-static-generation`\n )\n }\n\n const defaultLocaleType = typeof i18n.defaultLocale\n\n if (!i18n.defaultLocale || defaultLocaleType !== 'string') {\n throw new Error(\n `Specified i18n.defaultLocale should be a string.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (typeof i18n.domains !== 'undefined' && !Array.isArray(i18n.domains)) {\n throw new Error(\n `Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (i18n.domains) {\n const invalidDomainItems = i18n.domains.filter((item) => {\n if (!item || typeof item !== 'object') return true\n if (!item.defaultLocale) return true\n if (!item.domain || typeof item.domain !== 'string') return true\n\n if (item.domain.includes(':')) {\n console.warn(\n `i18n domain: \"${item.domain}\" is invalid it should be a valid domain without protocol (https://) or port (:3000) e.g. example.vercel.sh`\n )\n return true\n }\n\n const defaultLocaleDuplicate = i18n.domains?.find(\n (altItem) =>\n altItem.defaultLocale === item.defaultLocale &&\n altItem.domain !== item.domain\n )\n\n if (!silent && defaultLocaleDuplicate) {\n console.warn(\n `Both ${item.domain} and ${defaultLocaleDuplicate.domain} configured the defaultLocale ${item.defaultLocale} but only one can. Change one item's default locale to continue`\n )\n return true\n }\n\n let hasInvalidLocale = false\n\n if (Array.isArray(item.locales)) {\n for (const locale of item.locales) {\n if (typeof locale !== 'string') hasInvalidLocale = true\n\n for (const domainItem of i18n.domains || []) {\n if (domainItem === item) continue\n if (domainItem.locales && domainItem.locales.includes(locale)) {\n console.warn(\n `Both ${item.domain} and ${domainItem.domain} configured the locale (${locale}) but only one can. Remove it from one i18n.domains config to continue`\n )\n hasInvalidLocale = true\n break\n }\n }\n }\n }\n\n return hasInvalidLocale\n })\n\n if (invalidDomainItems.length > 0) {\n throw new Error(\n `Invalid i18n.domains values:\\n${invalidDomainItems\n .map((item: any) => JSON.stringify(item))\n .join(\n '\\n'\n )}\\n\\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n }\n\n if (!Array.isArray(i18n.locales)) {\n throw new Error(\n `Specified i18n.locales must be an array of locale strings e.g. [\"en-US\", \"nl-NL\"] received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n const invalidLocales = i18n.locales.filter(\n (locale: any) => typeof locale !== 'string'\n )\n\n if (invalidLocales.length > 0) {\n throw new Error(\n `Specified i18n.locales contains invalid values (${invalidLocales\n .map(String)\n .join(\n ', '\n )}), locales must be valid locale tags provided as strings e.g. \"en-US\".\\n` +\n `See here for list of valid language sub-tags: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry`\n )\n }\n\n if (!i18n.locales.includes(i18n.defaultLocale)) {\n throw new Error(\n `Specified i18n.defaultLocale should be included in i18n.locales.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n const normalizedLocales = new Set()\n const duplicateLocales = new Set()\n\n i18n.locales.forEach((locale) => {\n const localeLower = locale.toLowerCase()\n if (normalizedLocales.has(localeLower)) {\n duplicateLocales.add(locale)\n }\n normalizedLocales.add(localeLower)\n })\n\n if (duplicateLocales.size > 0) {\n throw new Error(\n `Specified i18n.locales contains the following duplicate locales:\\n` +\n `${[...duplicateLocales].join(', ')}\\n` +\n `Each locale should be listed only once.\\n` +\n `See more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n // make sure default Locale is at the front\n i18n.locales = [\n i18n.defaultLocale,\n ...i18n.locales.filter((locale) => locale !== i18n.defaultLocale),\n ]\n\n const localeDetectionType = typeof i18n.localeDetection\n\n if (\n localeDetectionType !== 'boolean' &&\n localeDetectionType !== 'undefined'\n ) {\n throw new Error(\n `Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n }\n\n if (result.devIndicators !== false && result.devIndicators?.position) {\n const { position } = result.devIndicators\n const allowedValues = [\n 'top-left',\n 'top-right',\n 'bottom-left',\n 'bottom-right',\n ]\n\n if (!allowedValues.includes(position)) {\n throw new Error(\n `Invalid \"devIndicator.position\" provided, expected one of ${allowedValues.join(\n ', '\n )}, received ${position}`\n )\n }\n }\n\n if (result.experimental) {\n result.experimental.cacheLife = {\n ...defaultConfig.experimental?.cacheLife,\n ...result.experimental.cacheLife,\n }\n const defaultDefault = defaultConfig.experimental?.cacheLife?.['default']\n if (\n !defaultDefault ||\n defaultDefault.revalidate === undefined ||\n defaultDefault.expire === undefined ||\n !defaultConfig.experimental?.staleTimes?.static\n ) {\n throw new Error('No default cacheLife profile.')\n }\n const defaultCacheLifeProfile = result.experimental.cacheLife['default']\n if (!defaultCacheLifeProfile) {\n result.experimental.cacheLife['default'] = defaultDefault\n } else {\n if (defaultCacheLifeProfile.stale === undefined) {\n const staticStaleTime = result.experimental.staleTimes?.static\n defaultCacheLifeProfile.stale =\n staticStaleTime ?? defaultConfig.experimental?.staleTimes?.static\n }\n if (defaultCacheLifeProfile.revalidate === undefined) {\n defaultCacheLifeProfile.revalidate = defaultDefault.revalidate\n }\n if (defaultCacheLifeProfile.expire === undefined) {\n defaultCacheLifeProfile.expire =\n result.expireTime ?? defaultDefault.expire\n }\n }\n }\n\n if (result.experimental?.cacheHandlers) {\n const allowedHandlerNameRegex = /[a-z-]/\n\n if (typeof result.experimental.cacheHandlers !== 'object') {\n throw new Error(\n `Invalid \"experimental.cacheHandlers\" provided, expected an object e.g. { default: '/my-handler.js' }, received ${JSON.stringify(result.experimental.cacheHandlers)}`\n )\n }\n\n const handlerKeys = Object.keys(result.experimental.cacheHandlers)\n const invalidHandlerItems: Array<{ key: string; reason: string }> = []\n\n for (const key of handlerKeys) {\n if (key === 'private') {\n invalidHandlerItems.push({\n key,\n reason:\n 'The cache handler for \"use cache: private\" cannot be customized.',\n })\n } else if (!allowedHandlerNameRegex.test(key)) {\n invalidHandlerItems.push({\n key,\n reason: 'key must only use characters a-z and -',\n })\n } else {\n const handlerPath = (\n result.experimental.cacheHandlers as {\n [handlerName: string]: string | undefined\n }\n )[key]\n\n if (handlerPath && !existsSync(handlerPath)) {\n invalidHandlerItems.push({\n key,\n reason: `cache handler path provided does not exist, received ${handlerPath}`,\n })\n }\n }\n if (invalidHandlerItems.length) {\n throw new Error(\n `Invalid handler fields configured for \"experimental.cacheHandler\":\\n${invalidHandlerItems.map((item) => `${key}: ${item.reason}`).join('\\n')}`\n )\n }\n }\n }\n\n const userProvidedModularizeImports = result.modularizeImports\n // Unfortunately these packages end up re-exporting 10600 modules, for example: https://unpkg.com/browse/@mui/icons-material@5.11.16/esm/index.js.\n // Leveraging modularizeImports tremendously reduces compile times for these.\n result.modularizeImports = {\n ...(userProvidedModularizeImports || {}),\n // This is intentionally added after the user-provided modularizeImports config.\n '@mui/icons-material': {\n transform: '@mui/icons-material/{{member}}',\n },\n lodash: {\n transform: 'lodash/{{member}}',\n },\n }\n\n const userProvidedOptimizePackageImports =\n result.experimental?.optimizePackageImports || []\n\n result.experimental.optimizePackageImports = [\n ...new Set([\n ...userProvidedOptimizePackageImports,\n 'lucide-react',\n 'date-fns',\n 'lodash-es',\n 'ramda',\n 'antd',\n 'react-bootstrap',\n 'ahooks',\n '@ant-design/icons',\n '@headlessui/react',\n '@headlessui-float/react',\n '@heroicons/react/20/solid',\n '@heroicons/react/24/solid',\n '@heroicons/react/24/outline',\n '@visx/visx',\n '@tremor/react',\n 'rxjs',\n '@mui/material',\n '@mui/icons-material',\n 'recharts',\n 'react-use',\n 'effect',\n '@effect/schema',\n '@effect/platform',\n '@effect/platform-node',\n '@effect/platform-browser',\n '@effect/platform-bun',\n '@effect/sql',\n '@effect/sql-mssql',\n '@effect/sql-mysql2',\n '@effect/sql-pg',\n '@effect/sql-sqlite-node',\n '@effect/sql-sqlite-bun',\n '@effect/sql-sqlite-wasm',\n '@effect/sql-sqlite-react-native',\n '@effect/rpc',\n '@effect/rpc-http',\n '@effect/typeclass',\n '@effect/experimental',\n '@effect/opentelemetry',\n '@material-ui/core',\n '@material-ui/icons',\n '@tabler/icons-react',\n 'mui-core',\n // We don't support wildcard imports for these configs, e.g. `react-icons/*`\n // so we need to add them manually.\n // In the future, we should consider automatically detecting packages that\n // need to be optimized.\n 'react-icons/ai',\n 'react-icons/bi',\n 'react-icons/bs',\n 'react-icons/cg',\n 'react-icons/ci',\n 'react-icons/di',\n 'react-icons/fa',\n 'react-icons/fa6',\n 'react-icons/fc',\n 'react-icons/fi',\n 'react-icons/gi',\n 'react-icons/go',\n 'react-icons/gr',\n 'react-icons/hi',\n 'react-icons/hi2',\n 'react-icons/im',\n 'react-icons/io',\n 'react-icons/io5',\n 'react-icons/lia',\n 'react-icons/lib',\n 'react-icons/lu',\n 'react-icons/md',\n 'react-icons/pi',\n 'react-icons/ri',\n 'react-icons/rx',\n 'react-icons/si',\n 'react-icons/sl',\n 'react-icons/tb',\n 'react-icons/tfi',\n 'react-icons/ti',\n 'react-icons/vsc',\n 'react-icons/wi',\n ]),\n ]\n\n if (!result.htmlLimitedBots) {\n // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string\n result.htmlLimitedBots = HTML_LIMITED_BOT_UA_RE_STRING\n }\n\n // \"use cache\" was originally implicitly enabled with the cacheComponents flag, so\n // we transfer the value for cacheComponents to the explicit useCache flag to ensure\n // backwards compatibility.\n if (result.experimental.useCache === undefined) {\n result.experimental.useCache = result.experimental.cacheComponents\n }\n\n // If cacheComponents is enabled, we also enable PPR.\n if (result.experimental.cacheComponents) {\n if (\n userConfig.experimental?.ppr === false ||\n userConfig.experimental?.ppr === 'incremental'\n ) {\n throw new Error(\n `\\`experimental.ppr\\` can not be \\`${JSON.stringify(userConfig.experimental?.ppr)}\\` when \\`experimental.cacheComponents\\` is \\`true\\`. PPR is implicitly enabled when Cache Components is enabled.`\n )\n }\n\n result.experimental.ppr = true\n }\n\n return result as NextConfigComplete\n}\n\nasync function applyModifyConfig(\n config: NextConfigComplete,\n phase: string,\n silent: boolean\n): Promise<NextConfigComplete> {\n if (\n // TODO: should this be called for server start as\n // adapters shouldn't be relying on \"next start\"\n [PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_SERVER].includes(phase) &&\n config.experimental?.adapterPath\n ) {\n const adapterMod = interopDefault(\n await import(\n pathToFileURL(require.resolve(config.experimental.adapterPath)).href\n )\n ) as NextAdapter\n\n if (typeof adapterMod.modifyConfig === 'function') {\n if (!silent) {\n Log.info(`Applying modifyConfig from ${adapterMod.name}`)\n }\n config = await adapterMod.modifyConfig(config)\n }\n }\n return config\n}\n\n// Cache config with keys to handle multiple configurations (e.g., multi-zone)\nconst configCache = new Map<\n string,\n {\n rawConfig: any\n config: NextConfigComplete\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[]\n }\n>()\n\n// Generate cache key based on parameters that affect config output\n// We need a unique key for cache because there can be multiple values\nfunction getCacheKey(\n phase: string,\n dir: string,\n customConfig?: object | null,\n reactProductionProfiling?: boolean,\n debugPrerender?: boolean\n): string {\n // The next.config.js is unique per project, so we can use the dir as the major key\n // to generate the unique config key.\n const keyData = JSON.stringify({\n dir,\n phase,\n hasCustomConfig: Boolean(customConfig),\n reactProductionProfiling: Boolean(reactProductionProfiling),\n debugPrerender: Boolean(debugPrerender),\n })\n\n return djb2Hash(keyData).toString(36)\n}\n\nexport default async function loadConfig(\n phase: string,\n dir: string,\n {\n customConfig,\n rawConfig,\n silent = true,\n reportExperimentalFeatures,\n reactProductionProfiling,\n debugPrerender,\n }: {\n customConfig?: object | null\n rawConfig?: boolean\n silent?: boolean\n reportExperimentalFeatures?: (\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[]\n ) => void\n reactProductionProfiling?: boolean\n debugPrerender?: boolean\n } = {}\n): Promise<NextConfigComplete> {\n // Generate cache key based on parameters that affect config output\n const cacheKey = getCacheKey(\n phase,\n dir,\n customConfig,\n reactProductionProfiling,\n debugPrerender\n )\n\n // Check if we have a cached result\n const cachedResult = configCache.get(cacheKey)\n if (cachedResult) {\n // Call the experimental features callback if provided\n if (reportExperimentalFeatures) {\n reportExperimentalFeatures(cachedResult.configuredExperimentalFeatures)\n }\n\n // Return raw config if requested and available\n if (rawConfig && cachedResult.rawConfig) {\n return cachedResult.rawConfig\n }\n\n return cachedResult.config\n }\n\n // Original implementation continues below...\n if (!process.env.__NEXT_PRIVATE_RENDER_WORKER) {\n try {\n loadWebpackHook()\n } catch (err) {\n // this can fail in standalone mode as the files\n // aren't traced/included\n if (!process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {\n throw err\n }\n }\n }\n\n if (process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {\n // we don't apply assignDefaults or modifyConfig here as it\n // has already been applied\n const standaloneConfig = JSON.parse(\n process.env.__NEXT_PRIVATE_STANDALONE_CONFIG\n )\n\n // Cache the standalone config\n configCache.set(cacheKey, {\n config: standaloneConfig,\n rawConfig: standaloneConfig,\n configuredExperimentalFeatures: [],\n })\n\n return standaloneConfig\n }\n\n const curLog = silent\n ? {\n warn: () => {},\n info: () => {},\n error: () => {},\n }\n : Log\n\n loadEnvConfig(dir, phase === PHASE_DEVELOPMENT_SERVER, curLog)\n\n let configFileName = 'next.config.js'\n const configuredExperimentalFeatures: ConfiguredExperimentalFeature[] = []\n\n if (customConfig) {\n const config = await applyModifyConfig(\n assignDefaults(\n dir,\n {\n configOrigin: 'server',\n configFileName,\n ...customConfig,\n },\n silent\n ) as NextConfigComplete,\n phase,\n silent\n )\n\n // Cache the custom config result\n configCache.set(cacheKey, {\n config,\n rawConfig: customConfig,\n configuredExperimentalFeatures,\n })\n\n reportExperimentalFeatures?.(configuredExperimentalFeatures)\n\n return config\n }\n\n const path = await findUp(CONFIG_FILES, { cwd: dir })\n\n // If config file was found\n if (path?.length) {\n configFileName = basename(path)\n\n let userConfigModule: any\n try {\n const envBefore = Object.assign({}, process.env)\n\n // `import()` expects url-encoded strings, so the path must be properly\n // escaped and (especially on Windows) absolute paths must pe prefixed\n // with the `file://` protocol\n if (process.env.__NEXT_TEST_MODE === 'jest') {\n // dynamic import does not currently work inside of vm which\n // jest relies on so we fall back to require for this case\n // https://github.com/nodejs/node/issues/35889\n userConfigModule = require(path)\n } else if (configFileName === 'next.config.ts') {\n userConfigModule = await transpileConfig({\n nextConfigPath: path,\n configFileName,\n cwd: dir,\n })\n } else {\n userConfigModule = await import(pathToFileURL(path).href)\n }\n const newEnv: typeof process.env = {} as any\n\n for (const key of Object.keys(process.env)) {\n if (envBefore[key] !== process.env[key]) {\n newEnv[key] = process.env[key]\n }\n }\n updateInitialEnv(newEnv)\n\n if (rawConfig) {\n // Cache the raw config\n configCache.set(cacheKey, {\n config: userConfigModule as NextConfigComplete,\n rawConfig: userConfigModule,\n configuredExperimentalFeatures,\n })\n\n reportExperimentalFeatures?.(configuredExperimentalFeatures)\n\n return userConfigModule\n }\n } catch (err) {\n // TODO: Modify docs to add cases of failing next.config.ts transformation\n curLog.error(\n `Failed to load ${configFileName}, see more info here https://nextjs.org/docs/messages/next-config-error`\n )\n throw err\n }\n\n const loadedConfig = Object.freeze(\n (await normalizeConfig(\n phase,\n interopDefault(userConfigModule)\n )) as NextConfig\n )\n\n if (loadedConfig.experimental) {\n for (const name of Object.keys(\n loadedConfig.experimental\n ) as (keyof ExperimentalConfig)[]) {\n const value = loadedConfig.experimental[name]\n\n if (name === 'turbo' && !process.env.TURBOPACK) {\n // Ignore any Turbopack config if Turbopack is not enabled\n continue\n }\n\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n name,\n value\n )\n }\n }\n\n // Clone a new userConfig each time to avoid mutating the original\n const userConfig = cloneObject(loadedConfig) as NextConfig\n\n // Always validate the config against schema in non minimal mode.\n // Only validate once in the root Next.js process, not in forked processes.\n const isRootProcess = typeof process.send !== 'function'\n if (!process.env.NEXT_MINIMAL && isRootProcess) {\n // We only validate the config against schema in non minimal mode\n const { configSchema } =\n require('./config-schema') as typeof import('./config-schema')\n const state = configSchema.safeParse(userConfig)\n\n if (!state.success) {\n // error message header\n const messages = [`Invalid ${configFileName} options detected: `]\n\n const [errorMessages, shouldExit] = normalizeNextConfigZodErrors(\n state.error\n )\n // ident list item\n for (const error of errorMessages) {\n messages.push(` ${error}`)\n }\n\n // error message footer\n messages.push(\n 'See more info here: https://nextjs.org/docs/messages/invalid-next-config'\n )\n\n if (shouldExit) {\n for (const message of messages) {\n console.error(message)\n }\n await flushAndExit(1)\n } else {\n for (const message of messages) {\n curLog.warn(message)\n }\n }\n }\n }\n\n if (userConfig.target && userConfig.target !== 'server') {\n throw new Error(\n `The \"target\" property is no longer supported in ${configFileName}.\\n` +\n 'See more info here https://nextjs.org/docs/messages/deprecated-target-config'\n )\n }\n\n if (userConfig.amp?.canonicalBase) {\n const { canonicalBase } = userConfig.amp || ({} as any)\n userConfig.amp = userConfig.amp || {}\n userConfig.amp.canonicalBase =\n (canonicalBase?.endsWith('/')\n ? canonicalBase.slice(0, -1)\n : canonicalBase) || ''\n }\n\n if (reactProductionProfiling) {\n userConfig.reactProductionProfiling = reactProductionProfiling\n }\n\n if (\n userConfig.experimental?.turbo?.loaders &&\n !userConfig.experimental?.turbo?.rules\n ) {\n curLog.warn(\n 'experimental.turbo.loaders is now deprecated. Please update next.config.js to use experimental.turbo.rules as soon as possible.\\n' +\n 'The new option is similar, but the key should be a glob instead of an extension.\\n' +\n 'Example: loaders: { \".mdx\": [\"mdx-loader\"] } -> rules: { \"*.mdx\": [\"mdx-loader\"] }\" }\\n' +\n 'See more info here https://nextjs.org/docs/app/api-reference/next-config-js/turbo'\n )\n\n const rules: Record<string, TurbopackLoaderItem[]> = {}\n for (const [ext, loaders] of Object.entries(\n userConfig.experimental.turbo.loaders\n )) {\n rules['*' + ext] = loaders as TurbopackLoaderItem[]\n }\n\n userConfig.experimental.turbo.rules = rules\n }\n\n if (userConfig.experimental?.turbo) {\n curLog.warn(\n 'The config property `experimental.turbo` is deprecated. Move this setting to `config.turbopack` or run `npx @next/codemod@latest next-experimental-turbo-to-turbopack .`'\n )\n\n // Merge the two configs, preferring values in `config.turbopack`.\n userConfig.turbopack = {\n ...userConfig.experimental.turbo,\n ...userConfig.turbopack,\n }\n userConfig.experimental.turbopackMemoryLimit ??=\n userConfig.experimental.turbo.memoryLimit\n userConfig.experimental.turbopackMinify ??=\n userConfig.experimental.turbo.minify\n userConfig.experimental.turbopackTreeShaking ??=\n userConfig.experimental.turbo.treeShaking\n userConfig.experimental.turbopackSourceMaps ??=\n userConfig.experimental.turbo.sourceMaps\n }\n\n if (userConfig.experimental?.useLightningcss) {\n const { loadBindings } =\n require('../build/swc') as typeof import('../build/swc')\n const isLightningSupported = (await loadBindings())?.css?.lightning\n\n if (!isLightningSupported) {\n curLog.warn(\n `experimental.useLightningcss is set, but the setting is disabled because next-swc/wasm does not support it yet.`\n )\n userConfig.experimental.useLightningcss = false\n }\n }\n\n // serialize the regex config into string\n if (userConfig?.htmlLimitedBots instanceof RegExp) {\n // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string\n userConfig.htmlLimitedBots = userConfig.htmlLimitedBots.source\n }\n\n enforceExperimentalFeatures(userConfig, {\n isDefaultConfig: false,\n configuredExperimentalFeatures,\n debugPrerender,\n phase,\n })\n\n const completeConfig = assignDefaults(\n dir,\n {\n configOrigin: relative(dir, path),\n configFile: path,\n configFileName,\n ...userConfig,\n },\n silent\n ) as NextConfigComplete\n\n const finalConfig = await applyModifyConfig(completeConfig, phase, silent)\n\n // Cache the final result\n configCache.set(cacheKey, {\n config: finalConfig,\n rawConfig: userConfigModule, // Store the original user config module\n configuredExperimentalFeatures,\n })\n\n if (reportExperimentalFeatures) {\n reportExperimentalFeatures(configuredExperimentalFeatures)\n }\n\n return finalConfig\n } else {\n const configBaseName = basename(CONFIG_FILES[0], extname(CONFIG_FILES[0]))\n const unsupportedConfig = findUp.sync(\n [\n `${configBaseName}.cjs`,\n `${configBaseName}.cts`,\n `${configBaseName}.mts`,\n `${configBaseName}.json`,\n `${configBaseName}.jsx`,\n `${configBaseName}.tsx`,\n ],\n { cwd: dir }\n )\n if (unsupportedConfig?.length) {\n throw new Error(\n `Configuring Next.js via '${basename(\n unsupportedConfig\n )}' is not supported. Please replace the file with 'next.config.js', 'next.config.mjs', or 'next.config.ts'.`\n )\n }\n }\n\n const clonedDefaultConfig = cloneObject(defaultConfig) as NextConfig\n\n enforceExperimentalFeatures(clonedDefaultConfig, {\n isDefaultConfig: true,\n configuredExperimentalFeatures,\n debugPrerender,\n phase,\n })\n\n // always call assignDefaults to ensure settings like\n // reactRoot can be updated correctly even with no next.config.js\n const completeConfig = assignDefaults(\n dir,\n { ...clonedDefaultConfig, configFileName },\n silent\n ) as NextConfigComplete\n\n setHttpClientAndAgentOptions(completeConfig)\n\n const finalConfig = await applyModifyConfig(completeConfig, phase, silent)\n\n // Cache the default config result\n configCache.set(cacheKey, {\n config: finalConfig,\n rawConfig: clonedDefaultConfig,\n configuredExperimentalFeatures,\n })\n\n if (reportExperimentalFeatures) {\n reportExperimentalFeatures(configuredExperimentalFeatures)\n }\n\n return finalConfig\n}\n\nexport type ConfiguredExperimentalFeature = {\n key: keyof ExperimentalConfig\n value: ExperimentalConfig[keyof ExperimentalConfig]\n reason?: string\n}\n\nfunction enforceExperimentalFeatures(\n config: NextConfig,\n options: {\n isDefaultConfig: boolean\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[] | undefined\n debugPrerender: boolean | undefined\n phase: string\n }\n) {\n const {\n configuredExperimentalFeatures,\n debugPrerender,\n isDefaultConfig,\n phase,\n } = options\n\n config.experimental ??= {}\n\n if (\n debugPrerender &&\n (phase === PHASE_PRODUCTION_BUILD || phase === PHASE_EXPORT)\n ) {\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n 'serverSourceMaps',\n true,\n configuredExperimentalFeatures\n )\n\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n process.env.TURBOPACK ? 'turbopackMinify' : 'serverMinification',\n false,\n configuredExperimentalFeatures\n )\n\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n 'enablePrerenderSourceMaps',\n true,\n configuredExperimentalFeatures\n )\n\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n 'prerenderEarlyExit',\n false,\n configuredExperimentalFeatures\n )\n }\n\n // TODO: Remove this once we've made Cache Components the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.ppr === undefined ||\n (isDefaultConfig && !config.experimental.ppr))\n ) {\n config.experimental.ppr = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'ppr',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS`'\n )\n }\n }\n\n // TODO: Remove this once we've made Cache Components the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.ppr === undefined ||\n (isDefaultConfig && !config.experimental.ppr))\n ) {\n config.experimental.ppr = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'ppr',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n )\n }\n }\n\n // TODO: Remove this once we've made Client Segment Cache the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.clientSegmentCache === undefined ||\n (isDefaultConfig && !config.experimental.clientSegmentCache))\n ) {\n config.experimental.clientSegmentCache = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'clientSegmentCache',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n )\n }\n }\n\n // TODO: Remove this once we've made Client Param Parsing the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.clientParamParsing === undefined ||\n (isDefaultConfig && !config.experimental.clientParamParsing))\n ) {\n config.experimental.clientParamParsing = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'clientParamParsing',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n )\n }\n }\n\n // TODO: Remove this once we've made Cache Components the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.cacheComponents === undefined ||\n (isDefaultConfig && !config.experimental.cacheComponents))\n ) {\n config.experimental.cacheComponents = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'cacheComponents',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS`'\n )\n }\n }\n\n if (\n config.experimental.enablePrerenderSourceMaps === undefined &&\n config.experimental.cacheComponents === true\n ) {\n config.experimental.enablePrerenderSourceMaps = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'enablePrerenderSourceMaps',\n true,\n 'enabled by `experimental.cacheComponents`'\n )\n }\n }\n}\n\nfunction addConfiguredExperimentalFeature<\n KeyType extends keyof ExperimentalConfig,\n>(\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[],\n key: KeyType,\n value: ExperimentalConfig[KeyType],\n reason?: string\n) {\n if (value !== (defaultConfig.experimental as Record<string, unknown>)[key]) {\n configuredExperimentalFeatures.push({ key, value, reason })\n }\n}\n\nfunction setExperimentalFeatureForDebugPrerender<\n KeyType extends keyof ExperimentalConfig,\n>(\n experimentalConfig: ExperimentalConfig,\n key: KeyType,\n value: ExperimentalConfig[KeyType],\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[] | undefined\n) {\n if (experimentalConfig[key] !== value) {\n experimentalConfig[key] = value\n\n if (configuredExperimentalFeatures) {\n const action =\n value === true ? 'enabled' : value === false ? 'disabled' : 'set'\n\n const reason = `${action} by \\`--debug-prerender\\``\n\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n key,\n value,\n reason\n )\n }\n }\n}\n\nfunction cloneObject(obj: any): any {\n // Primitives & null\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n // RegExp → clone via constructor\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags)\n }\n\n // Function → just reuse the function reference\n if (typeof obj === 'function') {\n return obj\n }\n\n // Arrays → map each element\n if (Array.isArray(obj)) {\n return obj.map(cloneObject)\n }\n\n // Detect non‑plain objects (class instances)\n const proto = Object.getPrototypeOf(obj)\n const isPlainObject = proto === Object.prototype || proto === null\n\n // If it's not a plain object, just return the original\n if (!isPlainObject) {\n return obj\n }\n\n // Plain object → create a new object with the same prototype\n // and copy all properties, cloning data properties and keeping\n // accessor properties (getters/setters) as‑is.\n const result = Object.create(proto)\n for (const key of Reflect.ownKeys(obj)) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key)\n\n if (descriptor && (descriptor.get || descriptor.set)) {\n // Accessor property → copy descriptor as‑is (get/set functions)\n Object.defineProperty(result, key, descriptor)\n } else {\n // Data property → clone the value\n result[key] = cloneObject(obj[key])\n }\n }\n\n return result\n}\n"],"names":["loadConfig","normalizeConfig","warnOptionHasBeenDeprecated","warnOptionHasBeenMovedOutOfExperimental","normalizeNextConfigZodErrors","error","shouldExit","issues","normalizeZodErrors","flatMap","issue","message","path","config","nestedPropertyKey","reason","silent","hasWarned","current","found","nestedPropertyKeys","split","key","undefined","Log","warnOnce","oldExperimentalKey","newKey","configFileName","experimental","warn","newKeys","length","shift","warnCustomizedOption","defaultValue","customMessage","segs","seg","assignDefaults","dir","userConfig","result","exportTrailingSlash","trailingSlash","dynamicIO","cacheComponents","Object","keys","reduce","currentConfig","value","Error","userDistDir","trim","Array","isArray","forEach","ext","defaultConfig","constructor","c","k","v","trustHostHeader","ciEnvironment","hasNextSupport","allowDevelopmentBuild","process","env","NODE_ENV","isStableBuild","ppr","CanaryOnlyError","feature","turbopackPersistentCaching","output","i18n","rewrites","redirects","headers","assetPrefix","basePath","startsWith","endsWith","amp","canonicalBase","images","localPatterns","hasMatch","some","pattern","pathname","search","push","remotePatterns","map","protocol","hostname","port","proto","replace","includes","url","URL","hasMatchForAssetPrefix","matchRemotePattern","domains","loader","imageConfigDefault","pathHasPrefix","loaderFile","absolutePath","join","existsSync","hasWarnedBuildActivityPosition","devIndicators","buildActivityPosition","position","outputStandalone","serverActions","bodySizeLimit","parseInt","toString","isNaN","outputFileTracingRoot","isAbsolute","resolve","turbopack","root","NEXT_DEPLOYMENT_ID","deploymentId","dset","rootDir","findRootDir","setHttpClientAndAgentOptions","hasAppDir","Boolean","findDir","i18nType","locales","defaultLocaleType","defaultLocale","invalidDomainItems","filter","item","domain","console","defaultLocaleDuplicate","find","altItem","hasInvalidLocale","locale","domainItem","JSON","stringify","invalidLocales","String","normalizedLocales","Set","duplicateLocales","localeLower","toLowerCase","has","add","size","localeDetectionType","localeDetection","allowedValues","cacheLife","defaultDefault","revalidate","expire","staleTimes","static","defaultCacheLifeProfile","stale","staticStaleTime","expireTime","cacheHandlers","allowedHandlerNameRegex","handlerKeys","invalidHandlerItems","test","handlerPath","userProvidedModularizeImports","modularizeImports","transform","lodash","userProvidedOptimizePackageImports","optimizePackageImports","htmlLimitedBots","HTML_LIMITED_BOT_UA_RE_STRING","useCache","applyModifyConfig","phase","PHASE_PRODUCTION_BUILD","PHASE_PRODUCTION_SERVER","adapterPath","adapterMod","interopDefault","pathToFileURL","require","href","modifyConfig","info","name","configCache","Map","getCacheKey","customConfig","reactProductionProfiling","debugPrerender","keyData","hasCustomConfig","djb2Hash","rawConfig","reportExperimentalFeatures","cacheKey","cachedResult","get","configuredExperimentalFeatures","__NEXT_PRIVATE_RENDER_WORKER","loadWebpackHook","err","__NEXT_PRIVATE_STANDALONE_CONFIG","standaloneConfig","parse","set","curLog","loadEnvConfig","PHASE_DEVELOPMENT_SERVER","configOrigin","findUp","CONFIG_FILES","cwd","basename","userConfigModule","envBefore","assign","__NEXT_TEST_MODE","transpileConfig","nextConfigPath","newEnv","updateInitialEnv","loadedConfig","freeze","TURBOPACK","addConfiguredExperimentalFeature","cloneObject","isRootProcess","send","NEXT_MINIMAL","configSchema","state","safeParse","success","messages","errorMessages","flushAndExit","target","slice","turbo","loaders","rules","entries","turbopackMemoryLimit","memoryLimit","turbopackMinify","minify","turbopackTreeShaking","treeShaking","turbopackSourceMaps","sourceMaps","useLightningcss","loadBindings","isLightningSupported","css","lightning","RegExp","source","enforceExperimentalFeatures","isDefaultConfig","completeConfig","relative","configFile","finalConfig","configBaseName","extname","unsupportedConfig","sync","clonedDefaultConfig","options","PHASE_EXPORT","setExperimentalFeatureForDebugPrerender","__NEXT_EXPERIMENTAL_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_PPR","clientSegmentCache","clientParamParsing","enablePrerenderSourceMaps","experimentalConfig","action","obj","flags","getPrototypeOf","isPlainObject","prototype","create","Reflect","ownKeys","descriptor","getOwnPropertyDescriptor","defineProperty"],"mappings":";;;;;;;;;;;;;;;;;IA8pCA,OAuZC;eAvZ6BA;;IAnnCrBC,eAAe;eAAfA,6BAAe;;IAqBRC,2BAA2B;eAA3BA;;IA2BAC,uCAAuC;eAAvCA;;;oBA3FW;sBAC4C;qBACzC;+DACX;6DACE;gEACU;2BAOxB;8BACwC;6BASf;6BACG;qBAEa;8BACnB;0BACD;mCACiB;+BACf;oCACK;iCAIH;sBACX;qBACc;uBACW;8BACtB;4BACuB;gCAChB;sBACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKzB,SAASC,6BACPC,KAA2B;IAE3B,IAAIC,aAAa;IACjB,MAAMC,SAASC,IAAAA,uBAAkB,EAACH;IAClC,OAAO;QACLE,OAAOE,OAAO,CAAC,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAE;YAChC,IAAID,MAAME,IAAI,CAAC,EAAE,KAAK,UAAU;gBAC9B,oEAAoE;gBACpEN,aAAa;YACf;YAEA,OAAOK;QACT;QACAL;KACD;AACH;AAEO,SAASJ,4BACdW,MAAkB,EAClBC,iBAAyB,EACzBC,MAAc,EACdC,MA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ChErL,OAAOyQ,cAAc,CAAC9Q,QAAQpB,KAAKgS;QACrC,OAAO;YACL,kCAAkC;YAClC5Q,MAAM,CAACpB,IAAI,GAAGmO,YAAYqD,GAAG,CAACxR,IAAI;QACpC;IACF;IAEA,OAAOoB;AACT","ignoreList":[0]}
1
+ {"version":3,"sources":["../../src/server/config.ts"],"sourcesContent":["import { existsSync } from 'fs'\nimport { basename, extname, join, relative, isAbsolute, resolve } from 'path'\nimport { pathToFileURL } from 'url'\nimport findUp from 'next/dist/compiled/find-up'\nimport * as Log from '../build/output/log'\nimport * as ciEnvironment from '../server/ci-info'\nimport {\n CONFIG_FILES,\n PHASE_DEVELOPMENT_SERVER,\n PHASE_EXPORT,\n PHASE_PRODUCTION_BUILD,\n PHASE_PRODUCTION_SERVER,\n} from '../shared/lib/constants'\nimport { defaultConfig, normalizeConfig } from './config-shared'\nimport type {\n ExperimentalConfig,\n NextConfigComplete,\n NextConfig,\n TurbopackLoaderItem,\n NextAdapter,\n} from './config-shared'\n\nimport { loadWebpackHook } from './config-utils'\nimport { imageConfigDefault } from '../shared/lib/image-config'\nimport type { ImageConfig } from '../shared/lib/image-config'\nimport { loadEnvConfig, updateInitialEnv } from '@next/env'\nimport { flushAndExit } from '../telemetry/flush-and-exit'\nimport { findRootDir } from '../lib/find-root'\nimport { setHttpClientAndAgentOptions } from './setup-http-agent-env'\nimport { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\nimport { matchRemotePattern } from '../shared/lib/match-remote-pattern'\n\nimport type { ZodError } from 'next/dist/compiled/zod'\nimport { hasNextSupport } from '../server/ci-info'\nimport { transpileConfig } from '../build/next-config-ts/transpile-config'\nimport { dset } from '../shared/lib/dset'\nimport { normalizeZodErrors } from '../shared/lib/zod'\nimport { HTML_LIMITED_BOT_UA_RE_STRING } from '../shared/lib/router/utils/is-bot'\nimport { findDir } from '../lib/find-pages-dir'\nimport { CanaryOnlyError, isStableBuild } from '../shared/lib/canary-only'\nimport { interopDefault } from '../lib/interop-default'\nimport { djb2Hash } from '../shared/lib/hash'\n\nexport { normalizeConfig } from './config-shared'\nexport type { DomainLocale, NextConfig } from './config-shared'\n\nfunction normalizeNextConfigZodErrors(\n error: ZodError<NextConfig>\n): [errorMessages: string[], shouldExit: boolean] {\n let shouldExit = false\n const issues = normalizeZodErrors(error)\n return [\n issues.flatMap(({ issue, message }) => {\n if (issue.path[0] === 'images') {\n // We exit the build when encountering an error in the images config\n shouldExit = true\n }\n\n return message\n }),\n shouldExit,\n ]\n}\n\nexport function warnOptionHasBeenDeprecated(\n config: NextConfig,\n nestedPropertyKey: string,\n reason: string,\n silent: boolean\n): boolean {\n let hasWarned = false\n if (!silent) {\n let current = config\n let found = true\n const nestedPropertyKeys = nestedPropertyKey.split('.')\n for (const key of nestedPropertyKeys) {\n if (current[key] !== undefined) {\n current = current[key]\n } else {\n found = false\n break\n }\n }\n if (found) {\n Log.warnOnce(reason)\n hasWarned = true\n }\n }\n return hasWarned\n}\n\nexport function warnOptionHasBeenMovedOutOfExperimental(\n config: NextConfig,\n oldExperimentalKey: string,\n newKey: string,\n configFileName: string,\n silent: boolean\n) {\n if (config.experimental && oldExperimentalKey in config.experimental) {\n if (!silent) {\n Log.warn(\n `\\`experimental.${oldExperimentalKey}\\` has been moved to \\`${newKey}\\`. ` +\n `Please update your ${configFileName} file accordingly.`\n )\n }\n\n let current = config\n const newKeys = newKey.split('.')\n while (newKeys.length > 1) {\n const key = newKeys.shift()!\n current[key] = current[key] || {}\n current = current[key]\n }\n current[newKeys.shift()!] = (config.experimental as any)[oldExperimentalKey]\n }\n\n return config\n}\n\nfunction warnCustomizedOption(\n config: NextConfig,\n key: string,\n defaultValue: any,\n customMessage: string,\n configFileName: string,\n silent: boolean\n) {\n const segs = key.split('.')\n let current = config\n\n while (segs.length >= 1) {\n const seg = segs.shift()!\n if (!(seg in current)) {\n return\n }\n current = current[seg]\n }\n\n if (!silent && current !== defaultValue) {\n Log.warn(\n `The \"${key}\" option has been modified. ${customMessage ? customMessage + '. ' : ''}It should be removed from your ${configFileName}.`\n )\n }\n}\n\nfunction assignDefaults(\n dir: string,\n userConfig: NextConfig & { configFileName: string },\n silent: boolean\n): NextConfigComplete {\n const configFileName = userConfig.configFileName\n if (typeof userConfig.exportTrailingSlash !== 'undefined') {\n if (!silent) {\n Log.warn(\n `The \"exportTrailingSlash\" option has been renamed to \"trailingSlash\". Please update your ${configFileName}.`\n )\n }\n if (typeof userConfig.trailingSlash === 'undefined') {\n userConfig.trailingSlash = userConfig.exportTrailingSlash\n }\n delete userConfig.exportTrailingSlash\n }\n\n // Handle deprecation of experimental.dynamicIO and migrate to experimental.cacheComponents\n if (userConfig.experimental?.dynamicIO !== undefined) {\n warnOptionHasBeenDeprecated(\n userConfig,\n 'experimental.dynamicIO',\n `\\`experimental.dynamicIO\\` has been renamed to \\`experimental.cacheComponents\\`. Please update your ${configFileName} file accordingly.`,\n silent\n )\n\n // If cacheComponents was not explicitly set by the user (i.e., it's still the default value),\n // use the dynamicIO value. We check against the user config, not the merged result.\n if (userConfig.experimental?.cacheComponents === undefined) {\n userConfig.experimental.cacheComponents =\n userConfig.experimental.dynamicIO\n }\n\n // Remove the deprecated property\n delete userConfig.experimental.dynamicIO\n }\n\n const config = Object.keys(userConfig).reduce<{ [key: string]: any }>(\n (currentConfig, key) => {\n const value = userConfig[key]\n\n if (value === undefined || value === null) {\n return currentConfig\n }\n\n if (key === 'distDir') {\n if (typeof value !== 'string') {\n throw new Error(\n `Specified distDir is not a string, found type \"${typeof value}\"`\n )\n }\n const userDistDir = value.trim()\n\n // don't allow public as the distDir as this is a reserved folder for\n // public files\n if (userDistDir === 'public') {\n throw new Error(\n `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://nextjs.org/docs/messages/can-not-output-to-public`\n )\n }\n // make sure distDir isn't an empty string as it can result in the provided\n // directory being deleted in development mode\n if (userDistDir.length === 0) {\n throw new Error(\n `Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`\n )\n }\n }\n\n if (key === 'pageExtensions') {\n if (!Array.isArray(value)) {\n throw new Error(\n `Specified pageExtensions is not an array of strings, found \"${value}\". Please update this config or remove it.`\n )\n }\n\n if (!value.length) {\n throw new Error(\n `Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`\n )\n }\n\n value.forEach((ext) => {\n if (typeof ext !== 'string') {\n throw new Error(\n `Specified pageExtensions is not an array of strings, found \"${ext}\" of type \"${typeof ext}\". Please update this config or remove it.`\n )\n }\n })\n }\n\n const defaultValue = (defaultConfig as Record<string, unknown>)[key]\n\n if (\n !!value &&\n value.constructor === Object &&\n typeof defaultValue === 'object'\n ) {\n currentConfig[key] = {\n ...defaultValue,\n ...Object.keys(value).reduce<any>((c, k) => {\n const v = value[k]\n if (v !== undefined && v !== null) {\n c[k] = v\n }\n return c\n }, {}),\n }\n } else {\n currentConfig[key] = value\n }\n\n return currentConfig\n },\n {}\n ) as NextConfig & { configFileName: string }\n\n const result = {\n ...defaultConfig,\n ...config,\n experimental: {\n ...defaultConfig.experimental,\n ...config.experimental,\n },\n }\n\n // ensure correct default is set for api-resolver revalidate handling\n if (!result.experimental?.trustHostHeader && ciEnvironment.hasNextSupport) {\n result.experimental.trustHostHeader = true\n }\n\n if (\n result.experimental?.allowDevelopmentBuild &&\n process.env.NODE_ENV !== 'development'\n ) {\n throw new Error(\n `The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.`\n )\n }\n\n if (isStableBuild()) {\n // Prevents usage of certain experimental features outside of canary\n if (result.experimental?.ppr) {\n throw new CanaryOnlyError({ feature: 'experimental.ppr' })\n } else if (result.experimental?.cacheComponents) {\n throw new CanaryOnlyError({ feature: 'experimental.cacheComponents' })\n } else if (result.experimental?.turbopackPersistentCaching) {\n throw new CanaryOnlyError({\n feature: 'experimental.turbopackPersistentCaching',\n })\n }\n }\n\n if (result.output === 'export') {\n if (result.i18n) {\n throw new Error(\n 'Specified \"i18n\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-i18n'\n )\n }\n\n if (!hasNextSupport) {\n if (result.rewrites) {\n Log.warn(\n 'Specified \"rewrites\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n )\n }\n if (result.redirects) {\n Log.warn(\n 'Specified \"redirects\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n )\n }\n if (result.headers) {\n Log.warn(\n 'Specified \"headers\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n )\n }\n }\n }\n\n if (typeof result.assetPrefix !== 'string') {\n throw new Error(\n `Specified assetPrefix is not a string, found type \"${typeof result.assetPrefix}\" https://nextjs.org/docs/messages/invalid-assetprefix`\n )\n }\n\n if (typeof result.basePath !== 'string') {\n throw new Error(\n `Specified basePath is not a string, found type \"${typeof result.basePath}\"`\n )\n }\n\n if (result.basePath !== '') {\n if (result.basePath === '/') {\n throw new Error(\n `Specified basePath /. basePath has to be either an empty string or a path prefix\"`\n )\n }\n\n if (!result.basePath.startsWith('/')) {\n throw new Error(\n `Specified basePath has to start with a /, found \"${result.basePath}\"`\n )\n }\n\n if (result.basePath !== '/') {\n if (result.basePath.endsWith('/')) {\n throw new Error(\n `Specified basePath should not end with /, found \"${result.basePath}\"`\n )\n }\n\n if (result.assetPrefix === '') {\n result.assetPrefix = result.basePath\n }\n\n if (result.amp?.canonicalBase === '') {\n result.amp.canonicalBase = result.basePath\n }\n }\n }\n\n if (result?.images) {\n const images: ImageConfig = result.images\n\n if (typeof images !== 'object') {\n throw new Error(\n `Specified images should be an object received ${typeof images}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n if (images.localPatterns) {\n if (!Array.isArray(images.localPatterns)) {\n throw new Error(\n `Specified images.localPatterns should be an Array received ${typeof images.localPatterns}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n // avoid double-pushing the same pattern if it already exists\n const hasMatch = images.localPatterns.some(\n (pattern) =>\n pattern.pathname === '/_next/static/media/**' && pattern.search === ''\n )\n if (!hasMatch) {\n // static import images are automatically allowed\n images.localPatterns.push({\n pathname: '/_next/static/media/**',\n search: '',\n })\n }\n }\n\n if (images.remotePatterns) {\n if (!Array.isArray(images.remotePatterns)) {\n throw new Error(\n `Specified images.remotePatterns should be an Array received ${typeof images.remotePatterns}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n // We must convert URL to RemotePattern since URL has a colon in the protocol\n // and also has additional properties we want to filter out. Also, new URL()\n // accepts any protocol so we need manual validation here.\n images.remotePatterns = images.remotePatterns.map(\n ({ protocol, hostname, port, pathname, search }) => {\n const proto = protocol?.replace(/:$/, '')\n if (!['http', 'https', undefined].includes(proto)) {\n throw new Error(\n `Specified images.remotePatterns must have protocol \"http\" or \"https\" received \"${proto}\".`\n )\n }\n return {\n protocol: proto as 'http' | 'https' | undefined,\n hostname,\n port,\n pathname,\n search,\n }\n }\n )\n\n // static images are automatically prefixed with assetPrefix\n // so we need to ensure _next/image allows downloading from\n // this resource\n if (config.assetPrefix?.startsWith('http')) {\n try {\n const url = new URL(config.assetPrefix)\n const hasMatchForAssetPrefix = images.remotePatterns.some((pattern) =>\n matchRemotePattern(pattern, url)\n )\n\n // avoid double-pushing the same pattern if it already can be matched\n if (!hasMatchForAssetPrefix) {\n images.remotePatterns.push({\n hostname: url.hostname,\n protocol: url.protocol.replace(/:$/, '') as 'http' | 'https',\n port: url.port,\n })\n }\n } catch (error) {\n throw new Error(\n `Invalid assetPrefix provided. Original error: ${error}`\n )\n }\n }\n }\n\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 ) {\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 // There are a good amount of test fixtures that have amp enabled\n // that also assert on stderr output being empty, so we're gating the\n // warning to be skipped when running in Next.js tests until we fully\n // remove the feature.\n if (!process.env.__NEXT_TEST_MODE) {\n warnOptionHasBeenDeprecated(\n result,\n 'amp',\n `Built-in amp support is deprecated and the \\`amp\\` configuration option will be removed in Next.js 16.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'experimental.amp',\n `Built-in amp support is deprecated and the \\`experimental.amp\\` configuration option will be removed in Next.js 16.`,\n silent\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 warnOptionHasBeenDeprecated(\n result,\n 'experimental.instrumentationHook',\n `\\`experimental.instrumentationHook\\` is no longer needed, because \\`instrumentation.js\\` is available by default. You can remove it from ${configFileName}.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'experimental.after',\n `\\`experimental.after\\` is no longer needed, because \\`after\\` is available by default. You can remove it from ${configFileName}.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'devIndicators.appIsrStatus',\n `\\`devIndicators.appIsrStatus\\` is deprecated and no longer configurable. Please remove it from ${configFileName}.`,\n silent\n )\n\n warnOptionHasBeenDeprecated(\n result,\n 'devIndicators.buildActivity',\n `\\`devIndicators.buildActivity\\` is deprecated and no longer configurable. Please remove it from ${configFileName}.`,\n silent\n )\n\n const hasWarnedBuildActivityPosition = warnOptionHasBeenDeprecated(\n result,\n 'devIndicators.buildActivityPosition',\n `\\`devIndicators.buildActivityPosition\\` has been renamed to \\`devIndicators.position\\`. Please update your ${configFileName} file accordingly.`,\n silent\n )\n if (\n hasWarnedBuildActivityPosition &&\n result.devIndicators !== false &&\n 'buildActivityPosition' in result.devIndicators &&\n result.devIndicators.buildActivityPosition !== result.devIndicators.position\n ) {\n Log.warnOnce(\n `The \\`devIndicators\\` option \\`buildActivityPosition\\` (\"${result.devIndicators.buildActivityPosition}\") conflicts with \\`position\\` (\"${result.devIndicators.position}\"). Using \\`buildActivityPosition\\` (\"${result.devIndicators.buildActivityPosition}\") for backward compatibility.`\n )\n result.devIndicators.position = result.devIndicators.buildActivityPosition\n }\n\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'bundlePagesExternals',\n 'bundlePagesRouterDependencies',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'serverComponentsExternalPackages',\n 'serverExternalPackages',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'relay',\n 'compiler.relay',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'styledComponents',\n 'compiler.styledComponents',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'emotion',\n 'compiler.emotion',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'reactRemoveProperties',\n 'compiler.reactRemoveProperties',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'removeConsole',\n 'compiler.removeConsole',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'swrDelta',\n 'expireTime',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'outputFileTracingRoot',\n 'outputFileTracingRoot',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'outputFileTracingIncludes',\n 'outputFileTracingIncludes',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'outputFileTracingExcludes',\n 'outputFileTracingExcludes',\n configFileName,\n silent\n )\n\n if ((result.experimental as any).outputStandalone) {\n if (!silent) {\n Log.warn(\n `experimental.outputStandalone has been renamed to \"output: 'standalone'\", please move the config.`\n )\n }\n result.output = 'standalone'\n }\n\n if (\n typeof result.experimental?.serverActions?.bodySizeLimit !== 'undefined'\n ) {\n const value = parseInt(\n result.experimental.serverActions?.bodySizeLimit.toString()\n )\n if (isNaN(value) || value < 1) {\n throw new Error(\n 'Server Actions Size Limit must be a valid number or filesize format larger than 1MB: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit'\n )\n }\n }\n\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'transpilePackages',\n 'transpilePackages',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'skipMiddlewareUrlNormalize',\n 'skipMiddlewareUrlNormalize',\n configFileName,\n silent\n )\n warnOptionHasBeenMovedOutOfExperimental(\n result,\n 'skipTrailingSlashRedirect',\n 'skipTrailingSlashRedirect',\n configFileName,\n silent\n )\n\n if (\n result?.outputFileTracingRoot &&\n !isAbsolute(result.outputFileTracingRoot)\n ) {\n result.outputFileTracingRoot = resolve(result.outputFileTracingRoot)\n if (!silent) {\n Log.warn(\n `outputFileTracingRoot should be absolute, using: ${result.outputFileTracingRoot}`\n )\n }\n }\n\n if (result?.turbopack?.root && !isAbsolute(result.turbopack.root)) {\n result.turbopack.root = resolve(result.turbopack.root)\n if (!silent) {\n Log.warn(\n `turbopack.root should be absolute, using: ${result.turbopack.root}`\n )\n }\n }\n\n // only leverage deploymentId\n if (process.env.NEXT_DEPLOYMENT_ID) {\n result.deploymentId = process.env.NEXT_DEPLOYMENT_ID\n }\n\n if (result?.outputFileTracingRoot && !result?.turbopack?.root) {\n dset(result, ['turbopack', 'root'], result.outputFileTracingRoot)\n }\n\n // use the highest level lockfile as tracing root\n if (!result?.outputFileTracingRoot && !result?.turbopack?.root) {\n let rootDir = findRootDir(dir)\n\n if (rootDir) {\n result.outputFileTracingRoot = rootDir\n dset(result, ['turbopack', 'root'], rootDir)\n }\n }\n\n setHttpClientAndAgentOptions(result || defaultConfig)\n\n if (result.i18n) {\n const hasAppDir = Boolean(findDir(dir, 'app'))\n\n if (hasAppDir) {\n warnOptionHasBeenDeprecated(\n result,\n 'i18n',\n `i18n configuration in ${configFileName} is unsupported in App Router.\\nLearn more about internationalization in App Router: https://nextjs.org/docs/app/building-your-application/routing/internationalization`,\n silent\n )\n }\n\n const { i18n } = result\n const i18nType = typeof i18n\n\n if (i18nType !== 'object') {\n throw new Error(\n `Specified i18n should be an object received ${i18nType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (!Array.isArray(i18n.locales)) {\n throw new Error(\n `Specified i18n.locales should be an Array received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (i18n.locales.length > 100 && !silent) {\n Log.warn(\n `Received ${i18n.locales.length} i18n.locales items which exceeds the recommended max of 100.\\nSee more info here: https://nextjs.org/docs/advanced-features/i18n-routing#how-does-this-work-with-static-generation`\n )\n }\n\n const defaultLocaleType = typeof i18n.defaultLocale\n\n if (!i18n.defaultLocale || defaultLocaleType !== 'string') {\n throw new Error(\n `Specified i18n.defaultLocale should be a string.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (typeof i18n.domains !== 'undefined' && !Array.isArray(i18n.domains)) {\n throw new Error(\n `Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (i18n.domains) {\n const invalidDomainItems = i18n.domains.filter((item) => {\n if (!item || typeof item !== 'object') return true\n if (!item.defaultLocale) return true\n if (!item.domain || typeof item.domain !== 'string') return true\n\n if (item.domain.includes(':')) {\n console.warn(\n `i18n domain: \"${item.domain}\" is invalid it should be a valid domain without protocol (https://) or port (:3000) e.g. example.vercel.sh`\n )\n return true\n }\n\n const defaultLocaleDuplicate = i18n.domains?.find(\n (altItem) =>\n altItem.defaultLocale === item.defaultLocale &&\n altItem.domain !== item.domain\n )\n\n if (!silent && defaultLocaleDuplicate) {\n console.warn(\n `Both ${item.domain} and ${defaultLocaleDuplicate.domain} configured the defaultLocale ${item.defaultLocale} but only one can. Change one item's default locale to continue`\n )\n return true\n }\n\n let hasInvalidLocale = false\n\n if (Array.isArray(item.locales)) {\n for (const locale of item.locales) {\n if (typeof locale !== 'string') hasInvalidLocale = true\n\n for (const domainItem of i18n.domains || []) {\n if (domainItem === item) continue\n if (domainItem.locales && domainItem.locales.includes(locale)) {\n console.warn(\n `Both ${item.domain} and ${domainItem.domain} configured the locale (${locale}) but only one can. Remove it from one i18n.domains config to continue`\n )\n hasInvalidLocale = true\n break\n }\n }\n }\n }\n\n return hasInvalidLocale\n })\n\n if (invalidDomainItems.length > 0) {\n throw new Error(\n `Invalid i18n.domains values:\\n${invalidDomainItems\n .map((item: any) => JSON.stringify(item))\n .join(\n '\\n'\n )}\\n\\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n }\n\n if (!Array.isArray(i18n.locales)) {\n throw new Error(\n `Specified i18n.locales must be an array of locale strings e.g. [\"en-US\", \"nl-NL\"] received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n const invalidLocales = i18n.locales.filter(\n (locale: any) => typeof locale !== 'string'\n )\n\n if (invalidLocales.length > 0) {\n throw new Error(\n `Specified i18n.locales contains invalid values (${invalidLocales\n .map(String)\n .join(\n ', '\n )}), locales must be valid locale tags provided as strings e.g. \"en-US\".\\n` +\n `See here for list of valid language sub-tags: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry`\n )\n }\n\n if (!i18n.locales.includes(i18n.defaultLocale)) {\n throw new Error(\n `Specified i18n.defaultLocale should be included in i18n.locales.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n const normalizedLocales = new Set()\n const duplicateLocales = new Set()\n\n i18n.locales.forEach((locale) => {\n const localeLower = locale.toLowerCase()\n if (normalizedLocales.has(localeLower)) {\n duplicateLocales.add(locale)\n }\n normalizedLocales.add(localeLower)\n })\n\n if (duplicateLocales.size > 0) {\n throw new Error(\n `Specified i18n.locales contains the following duplicate locales:\\n` +\n `${[...duplicateLocales].join(', ')}\\n` +\n `Each locale should be listed only once.\\n` +\n `See more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n // make sure default Locale is at the front\n i18n.locales = [\n i18n.defaultLocale,\n ...i18n.locales.filter((locale) => locale !== i18n.defaultLocale),\n ]\n\n const localeDetectionType = typeof i18n.localeDetection\n\n if (\n localeDetectionType !== 'boolean' &&\n localeDetectionType !== 'undefined'\n ) {\n throw new Error(\n `Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n }\n\n if (result.devIndicators !== false && result.devIndicators?.position) {\n const { position } = result.devIndicators\n const allowedValues = [\n 'top-left',\n 'top-right',\n 'bottom-left',\n 'bottom-right',\n ]\n\n if (!allowedValues.includes(position)) {\n throw new Error(\n `Invalid \"devIndicator.position\" provided, expected one of ${allowedValues.join(\n ', '\n )}, received ${position}`\n )\n }\n }\n\n if (result.experimental) {\n result.experimental.cacheLife = {\n ...defaultConfig.experimental?.cacheLife,\n ...result.experimental.cacheLife,\n }\n const defaultDefault = defaultConfig.experimental?.cacheLife?.['default']\n if (\n !defaultDefault ||\n defaultDefault.revalidate === undefined ||\n defaultDefault.expire === undefined ||\n !defaultConfig.experimental?.staleTimes?.static\n ) {\n throw new Error('No default cacheLife profile.')\n }\n const defaultCacheLifeProfile = result.experimental.cacheLife['default']\n if (!defaultCacheLifeProfile) {\n result.experimental.cacheLife['default'] = defaultDefault\n } else {\n if (defaultCacheLifeProfile.stale === undefined) {\n const staticStaleTime = result.experimental.staleTimes?.static\n defaultCacheLifeProfile.stale =\n staticStaleTime ?? defaultConfig.experimental?.staleTimes?.static\n }\n if (defaultCacheLifeProfile.revalidate === undefined) {\n defaultCacheLifeProfile.revalidate = defaultDefault.revalidate\n }\n if (defaultCacheLifeProfile.expire === undefined) {\n defaultCacheLifeProfile.expire =\n result.expireTime ?? defaultDefault.expire\n }\n }\n }\n\n if (result.experimental?.cacheHandlers) {\n const allowedHandlerNameRegex = /[a-z-]/\n\n if (typeof result.experimental.cacheHandlers !== 'object') {\n throw new Error(\n `Invalid \"experimental.cacheHandlers\" provided, expected an object e.g. { default: '/my-handler.js' }, received ${JSON.stringify(result.experimental.cacheHandlers)}`\n )\n }\n\n const handlerKeys = Object.keys(result.experimental.cacheHandlers)\n const invalidHandlerItems: Array<{ key: string; reason: string }> = []\n\n for (const key of handlerKeys) {\n if (key === 'private') {\n invalidHandlerItems.push({\n key,\n reason:\n 'The cache handler for \"use cache: private\" cannot be customized.',\n })\n } else if (!allowedHandlerNameRegex.test(key)) {\n invalidHandlerItems.push({\n key,\n reason: 'key must only use characters a-z and -',\n })\n } else {\n const handlerPath = (\n result.experimental.cacheHandlers as {\n [handlerName: string]: string | undefined\n }\n )[key]\n\n if (handlerPath && !existsSync(handlerPath)) {\n invalidHandlerItems.push({\n key,\n reason: `cache handler path provided does not exist, received ${handlerPath}`,\n })\n }\n }\n if (invalidHandlerItems.length) {\n throw new Error(\n `Invalid handler fields configured for \"experimental.cacheHandler\":\\n${invalidHandlerItems.map((item) => `${key}: ${item.reason}`).join('\\n')}`\n )\n }\n }\n }\n\n const userProvidedModularizeImports = result.modularizeImports\n // Unfortunately these packages end up re-exporting 10600 modules, for example: https://unpkg.com/browse/@mui/icons-material@5.11.16/esm/index.js.\n // Leveraging modularizeImports tremendously reduces compile times for these.\n result.modularizeImports = {\n ...(userProvidedModularizeImports || {}),\n // This is intentionally added after the user-provided modularizeImports config.\n '@mui/icons-material': {\n transform: '@mui/icons-material/{{member}}',\n },\n lodash: {\n transform: 'lodash/{{member}}',\n },\n }\n\n const userProvidedOptimizePackageImports =\n result.experimental?.optimizePackageImports || []\n\n result.experimental.optimizePackageImports = [\n ...new Set([\n ...userProvidedOptimizePackageImports,\n 'lucide-react',\n 'date-fns',\n 'lodash-es',\n 'ramda',\n 'antd',\n 'react-bootstrap',\n 'ahooks',\n '@ant-design/icons',\n '@headlessui/react',\n '@headlessui-float/react',\n '@heroicons/react/20/solid',\n '@heroicons/react/24/solid',\n '@heroicons/react/24/outline',\n '@visx/visx',\n '@tremor/react',\n 'rxjs',\n '@mui/material',\n '@mui/icons-material',\n 'recharts',\n 'react-use',\n 'effect',\n '@effect/schema',\n '@effect/platform',\n '@effect/platform-node',\n '@effect/platform-browser',\n '@effect/platform-bun',\n '@effect/sql',\n '@effect/sql-mssql',\n '@effect/sql-mysql2',\n '@effect/sql-pg',\n '@effect/sql-sqlite-node',\n '@effect/sql-sqlite-bun',\n '@effect/sql-sqlite-wasm',\n '@effect/sql-sqlite-react-native',\n '@effect/rpc',\n '@effect/rpc-http',\n '@effect/typeclass',\n '@effect/experimental',\n '@effect/opentelemetry',\n '@material-ui/core',\n '@material-ui/icons',\n '@tabler/icons-react',\n 'mui-core',\n // We don't support wildcard imports for these configs, e.g. `react-icons/*`\n // so we need to add them manually.\n // In the future, we should consider automatically detecting packages that\n // need to be optimized.\n 'react-icons/ai',\n 'react-icons/bi',\n 'react-icons/bs',\n 'react-icons/cg',\n 'react-icons/ci',\n 'react-icons/di',\n 'react-icons/fa',\n 'react-icons/fa6',\n 'react-icons/fc',\n 'react-icons/fi',\n 'react-icons/gi',\n 'react-icons/go',\n 'react-icons/gr',\n 'react-icons/hi',\n 'react-icons/hi2',\n 'react-icons/im',\n 'react-icons/io',\n 'react-icons/io5',\n 'react-icons/lia',\n 'react-icons/lib',\n 'react-icons/lu',\n 'react-icons/md',\n 'react-icons/pi',\n 'react-icons/ri',\n 'react-icons/rx',\n 'react-icons/si',\n 'react-icons/sl',\n 'react-icons/tb',\n 'react-icons/tfi',\n 'react-icons/ti',\n 'react-icons/vsc',\n 'react-icons/wi',\n ]),\n ]\n\n if (!result.htmlLimitedBots) {\n // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string\n result.htmlLimitedBots = HTML_LIMITED_BOT_UA_RE_STRING\n }\n\n // \"use cache\" was originally implicitly enabled with the cacheComponents flag, so\n // we transfer the value for cacheComponents to the explicit useCache flag to ensure\n // backwards compatibility.\n if (result.experimental.useCache === undefined) {\n result.experimental.useCache = result.experimental.cacheComponents\n }\n\n // If cacheComponents is enabled, we also enable PPR.\n if (result.experimental.cacheComponents) {\n if (\n userConfig.experimental?.ppr === false ||\n userConfig.experimental?.ppr === 'incremental'\n ) {\n throw new Error(\n `\\`experimental.ppr\\` can not be \\`${JSON.stringify(userConfig.experimental?.ppr)}\\` when \\`experimental.cacheComponents\\` is \\`true\\`. PPR is implicitly enabled when Cache Components is enabled.`\n )\n }\n\n result.experimental.ppr = true\n }\n\n return result as NextConfigComplete\n}\n\nasync function applyModifyConfig(\n config: NextConfigComplete,\n phase: string,\n silent: boolean\n): Promise<NextConfigComplete> {\n if (\n // TODO: should this be called for server start as\n // adapters shouldn't be relying on \"next start\"\n [PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_SERVER].includes(phase) &&\n config.experimental?.adapterPath\n ) {\n const adapterMod = interopDefault(\n await import(\n pathToFileURL(require.resolve(config.experimental.adapterPath)).href\n )\n ) as NextAdapter\n\n if (typeof adapterMod.modifyConfig === 'function') {\n if (!silent) {\n Log.info(`Applying modifyConfig from ${adapterMod.name}`)\n }\n config = await adapterMod.modifyConfig(config)\n }\n }\n return config\n}\n\n// Cache config with keys to handle multiple configurations (e.g., multi-zone)\nconst configCache = new Map<\n string,\n {\n rawConfig: any\n config: NextConfigComplete\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[]\n }\n>()\n\n// Generate cache key based on parameters that affect config output\n// We need a unique key for cache because there can be multiple values\nfunction getCacheKey(\n phase: string,\n dir: string,\n customConfig?: object | null,\n reactProductionProfiling?: boolean,\n debugPrerender?: boolean\n): string {\n // The next.config.js is unique per project, so we can use the dir as the major key\n // to generate the unique config key.\n const keyData = JSON.stringify({\n dir,\n phase,\n hasCustomConfig: Boolean(customConfig),\n reactProductionProfiling: Boolean(reactProductionProfiling),\n debugPrerender: Boolean(debugPrerender),\n })\n\n return djb2Hash(keyData).toString(36)\n}\n\nexport default async function loadConfig(\n phase: string,\n dir: string,\n {\n customConfig,\n rawConfig,\n silent = true,\n reportExperimentalFeatures,\n reactProductionProfiling,\n debugPrerender,\n }: {\n customConfig?: object | null\n rawConfig?: boolean\n silent?: boolean\n reportExperimentalFeatures?: (\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[]\n ) => void\n reactProductionProfiling?: boolean\n debugPrerender?: boolean\n } = {}\n): Promise<NextConfigComplete> {\n // Generate cache key based on parameters that affect config output\n const cacheKey = getCacheKey(\n phase,\n dir,\n customConfig,\n reactProductionProfiling,\n debugPrerender\n )\n\n // Check if we have a cached result\n const cachedResult = configCache.get(cacheKey)\n if (cachedResult) {\n // Call the experimental features callback if provided\n if (reportExperimentalFeatures) {\n reportExperimentalFeatures(cachedResult.configuredExperimentalFeatures)\n }\n\n // Return raw config if requested and available\n if (rawConfig && cachedResult.rawConfig) {\n return cachedResult.rawConfig\n }\n\n return cachedResult.config\n }\n\n // Original implementation continues below...\n if (!process.env.__NEXT_PRIVATE_RENDER_WORKER) {\n try {\n loadWebpackHook()\n } catch (err) {\n // this can fail in standalone mode as the files\n // aren't traced/included\n if (!process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {\n throw err\n }\n }\n }\n\n if (process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {\n // we don't apply assignDefaults or modifyConfig here as it\n // has already been applied\n const standaloneConfig = JSON.parse(\n process.env.__NEXT_PRIVATE_STANDALONE_CONFIG\n )\n\n // Cache the standalone config\n configCache.set(cacheKey, {\n config: standaloneConfig,\n rawConfig: standaloneConfig,\n configuredExperimentalFeatures: [],\n })\n\n return standaloneConfig\n }\n\n const curLog = silent\n ? {\n warn: () => {},\n info: () => {},\n error: () => {},\n }\n : Log\n\n loadEnvConfig(dir, phase === PHASE_DEVELOPMENT_SERVER, curLog)\n\n let configFileName = 'next.config.js'\n const configuredExperimentalFeatures: ConfiguredExperimentalFeature[] = []\n\n if (customConfig) {\n const config = await applyModifyConfig(\n assignDefaults(\n dir,\n {\n configOrigin: 'server',\n configFileName,\n ...customConfig,\n },\n silent\n ) as NextConfigComplete,\n phase,\n silent\n )\n\n // Cache the custom config result\n configCache.set(cacheKey, {\n config,\n rawConfig: customConfig,\n configuredExperimentalFeatures,\n })\n\n reportExperimentalFeatures?.(configuredExperimentalFeatures)\n\n return config\n }\n\n const path = await findUp(CONFIG_FILES, { cwd: dir })\n\n // If config file was found\n if (path?.length) {\n configFileName = basename(path)\n\n let userConfigModule: any\n try {\n const envBefore = Object.assign({}, process.env)\n\n // `import()` expects url-encoded strings, so the path must be properly\n // escaped and (especially on Windows) absolute paths must pe prefixed\n // with the `file://` protocol\n if (process.env.__NEXT_TEST_MODE === 'jest') {\n // dynamic import does not currently work inside of vm which\n // jest relies on so we fall back to require for this case\n // https://github.com/nodejs/node/issues/35889\n userConfigModule = require(path)\n } else if (configFileName === 'next.config.ts') {\n userConfigModule = await transpileConfig({\n nextConfigPath: path,\n configFileName,\n cwd: dir,\n })\n } else {\n userConfigModule = await import(pathToFileURL(path).href)\n }\n const newEnv: typeof process.env = {} as any\n\n for (const key of Object.keys(process.env)) {\n if (envBefore[key] !== process.env[key]) {\n newEnv[key] = process.env[key]\n }\n }\n updateInitialEnv(newEnv)\n\n if (rawConfig) {\n // Cache the raw config\n configCache.set(cacheKey, {\n config: userConfigModule as NextConfigComplete,\n rawConfig: userConfigModule,\n configuredExperimentalFeatures,\n })\n\n reportExperimentalFeatures?.(configuredExperimentalFeatures)\n\n return userConfigModule\n }\n } catch (err) {\n // TODO: Modify docs to add cases of failing next.config.ts transformation\n curLog.error(\n `Failed to load ${configFileName}, see more info here https://nextjs.org/docs/messages/next-config-error`\n )\n throw err\n }\n\n const loadedConfig = Object.freeze(\n (await normalizeConfig(\n phase,\n interopDefault(userConfigModule)\n )) as NextConfig\n )\n\n if (loadedConfig.experimental) {\n for (const name of Object.keys(\n loadedConfig.experimental\n ) as (keyof ExperimentalConfig)[]) {\n const value = loadedConfig.experimental[name]\n\n if (name === 'turbo' && !process.env.TURBOPACK) {\n // Ignore any Turbopack config if Turbopack is not enabled\n continue\n }\n\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n name,\n value\n )\n }\n }\n\n // Clone a new userConfig each time to avoid mutating the original\n const userConfig = cloneObject(loadedConfig) as NextConfig\n\n // Always validate the config against schema in non minimal mode.\n // Only validate once in the root Next.js process, not in forked processes.\n const isRootProcess = typeof process.send !== 'function'\n if (!process.env.NEXT_MINIMAL && isRootProcess) {\n // We only validate the config against schema in non minimal mode\n const { configSchema } =\n require('./config-schema') as typeof import('./config-schema')\n const state = configSchema.safeParse(userConfig)\n\n if (!state.success) {\n // error message header\n const messages = [`Invalid ${configFileName} options detected: `]\n\n const [errorMessages, shouldExit] = normalizeNextConfigZodErrors(\n state.error\n )\n // ident list item\n for (const error of errorMessages) {\n messages.push(` ${error}`)\n }\n\n // error message footer\n messages.push(\n 'See more info here: https://nextjs.org/docs/messages/invalid-next-config'\n )\n\n if (shouldExit) {\n for (const message of messages) {\n console.error(message)\n }\n await flushAndExit(1)\n } else {\n for (const message of messages) {\n curLog.warn(message)\n }\n }\n }\n }\n\n if (userConfig.target && userConfig.target !== 'server') {\n throw new Error(\n `The \"target\" property is no longer supported in ${configFileName}.\\n` +\n 'See more info here https://nextjs.org/docs/messages/deprecated-target-config'\n )\n }\n\n if (userConfig.amp?.canonicalBase) {\n const { canonicalBase } = userConfig.amp || ({} as any)\n userConfig.amp = userConfig.amp || {}\n userConfig.amp.canonicalBase =\n (canonicalBase?.endsWith('/')\n ? canonicalBase.slice(0, -1)\n : canonicalBase) || ''\n }\n\n if (reactProductionProfiling) {\n userConfig.reactProductionProfiling = reactProductionProfiling\n }\n\n if (\n userConfig.experimental?.turbo?.loaders &&\n !userConfig.experimental?.turbo?.rules\n ) {\n curLog.warn(\n 'experimental.turbo.loaders is now deprecated. Please update next.config.js to use experimental.turbo.rules as soon as possible.\\n' +\n 'The new option is similar, but the key should be a glob instead of an extension.\\n' +\n 'Example: loaders: { \".mdx\": [\"mdx-loader\"] } -> rules: { \"*.mdx\": [\"mdx-loader\"] }\" }\\n' +\n 'See more info here https://nextjs.org/docs/app/api-reference/next-config-js/turbo'\n )\n\n const rules: Record<string, TurbopackLoaderItem[]> = {}\n for (const [ext, loaders] of Object.entries(\n userConfig.experimental.turbo.loaders\n )) {\n rules['*' + ext] = loaders as TurbopackLoaderItem[]\n }\n\n userConfig.experimental.turbo.rules = rules\n }\n\n if (userConfig.experimental?.turbo) {\n curLog.warn(\n 'The config property `experimental.turbo` is deprecated. Move this setting to `config.turbopack` or run `npx @next/codemod@latest next-experimental-turbo-to-turbopack .`'\n )\n\n // Merge the two configs, preferring values in `config.turbopack`.\n userConfig.turbopack = {\n ...userConfig.experimental.turbo,\n ...userConfig.turbopack,\n }\n userConfig.experimental.turbopackMemoryLimit ??=\n userConfig.experimental.turbo.memoryLimit\n userConfig.experimental.turbopackMinify ??=\n userConfig.experimental.turbo.minify\n userConfig.experimental.turbopackTreeShaking ??=\n userConfig.experimental.turbo.treeShaking\n userConfig.experimental.turbopackSourceMaps ??=\n userConfig.experimental.turbo.sourceMaps\n }\n\n if (userConfig.experimental?.useLightningcss) {\n const { loadBindings } =\n require('../build/swc') as typeof import('../build/swc')\n const isLightningSupported = (await loadBindings())?.css?.lightning\n\n if (!isLightningSupported) {\n curLog.warn(\n `experimental.useLightningcss is set, but the setting is disabled because next-swc/wasm does not support it yet.`\n )\n userConfig.experimental.useLightningcss = false\n }\n }\n\n // serialize the regex config into string\n if (userConfig?.htmlLimitedBots instanceof RegExp) {\n // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string\n userConfig.htmlLimitedBots = userConfig.htmlLimitedBots.source\n }\n\n enforceExperimentalFeatures(userConfig, {\n isDefaultConfig: false,\n configuredExperimentalFeatures,\n debugPrerender,\n phase,\n })\n\n const completeConfig = assignDefaults(\n dir,\n {\n configOrigin: relative(dir, path),\n configFile: path,\n configFileName,\n ...userConfig,\n },\n silent\n ) as NextConfigComplete\n\n const finalConfig = await applyModifyConfig(completeConfig, phase, silent)\n\n // Cache the final result\n configCache.set(cacheKey, {\n config: finalConfig,\n rawConfig: userConfigModule, // Store the original user config module\n configuredExperimentalFeatures,\n })\n\n if (reportExperimentalFeatures) {\n reportExperimentalFeatures(configuredExperimentalFeatures)\n }\n\n return finalConfig\n } else {\n const configBaseName = basename(CONFIG_FILES[0], extname(CONFIG_FILES[0]))\n const unsupportedConfig = findUp.sync(\n [\n `${configBaseName}.cjs`,\n `${configBaseName}.cts`,\n `${configBaseName}.mts`,\n `${configBaseName}.json`,\n `${configBaseName}.jsx`,\n `${configBaseName}.tsx`,\n ],\n { cwd: dir }\n )\n if (unsupportedConfig?.length) {\n throw new Error(\n `Configuring Next.js via '${basename(\n unsupportedConfig\n )}' is not supported. Please replace the file with 'next.config.js', 'next.config.mjs', or 'next.config.ts'.`\n )\n }\n }\n\n const clonedDefaultConfig = cloneObject(defaultConfig) as NextConfig\n\n enforceExperimentalFeatures(clonedDefaultConfig, {\n isDefaultConfig: true,\n configuredExperimentalFeatures,\n debugPrerender,\n phase,\n })\n\n // always call assignDefaults to ensure settings like\n // reactRoot can be updated correctly even with no next.config.js\n const completeConfig = assignDefaults(\n dir,\n { ...clonedDefaultConfig, configFileName },\n silent\n ) as NextConfigComplete\n\n setHttpClientAndAgentOptions(completeConfig)\n\n const finalConfig = await applyModifyConfig(completeConfig, phase, silent)\n\n // Cache the default config result\n configCache.set(cacheKey, {\n config: finalConfig,\n rawConfig: clonedDefaultConfig,\n configuredExperimentalFeatures,\n })\n\n if (reportExperimentalFeatures) {\n reportExperimentalFeatures(configuredExperimentalFeatures)\n }\n\n return finalConfig\n}\n\nexport type ConfiguredExperimentalFeature = {\n key: keyof ExperimentalConfig\n value: ExperimentalConfig[keyof ExperimentalConfig]\n reason?: string\n}\n\nfunction enforceExperimentalFeatures(\n config: NextConfig,\n options: {\n isDefaultConfig: boolean\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[] | undefined\n debugPrerender: boolean | undefined\n phase: string\n }\n) {\n const {\n configuredExperimentalFeatures,\n debugPrerender,\n isDefaultConfig,\n phase,\n } = options\n\n config.experimental ??= {}\n\n if (\n debugPrerender &&\n (phase === PHASE_PRODUCTION_BUILD || phase === PHASE_EXPORT)\n ) {\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n 'serverSourceMaps',\n true,\n configuredExperimentalFeatures\n )\n\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n process.env.TURBOPACK ? 'turbopackMinify' : 'serverMinification',\n false,\n configuredExperimentalFeatures\n )\n\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n 'enablePrerenderSourceMaps',\n true,\n configuredExperimentalFeatures\n )\n\n setExperimentalFeatureForDebugPrerender(\n config.experimental,\n 'prerenderEarlyExit',\n false,\n configuredExperimentalFeatures\n )\n }\n\n // TODO: Remove this once we've made Cache Components the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.ppr === undefined ||\n (isDefaultConfig && !config.experimental.ppr))\n ) {\n config.experimental.ppr = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'ppr',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS`'\n )\n }\n }\n\n // TODO: Remove this once we've made Cache Components the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.ppr === undefined ||\n (isDefaultConfig && !config.experimental.ppr))\n ) {\n config.experimental.ppr = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'ppr',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n )\n }\n }\n\n // TODO: Remove this once we've made Client Segment Cache the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.clientSegmentCache === undefined ||\n (isDefaultConfig && !config.experimental.clientSegmentCache))\n ) {\n config.experimental.clientSegmentCache = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'clientSegmentCache',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n )\n }\n }\n\n // TODO: Remove this once we've made Client Param Parsing the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.clientParamParsing === undefined ||\n (isDefaultConfig && !config.experimental.clientParamParsing))\n ) {\n config.experimental.clientParamParsing = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'clientParamParsing',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n )\n }\n }\n\n // TODO: Remove this once we've made Cache Components the default.\n if (\n process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' &&\n // We do respect an explicit value in the user config.\n (config.experimental.cacheComponents === undefined ||\n (isDefaultConfig && !config.experimental.cacheComponents))\n ) {\n config.experimental.cacheComponents = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'cacheComponents',\n true,\n 'enabled by `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS`'\n )\n }\n }\n\n if (\n config.experimental.enablePrerenderSourceMaps === undefined &&\n config.experimental.cacheComponents === true\n ) {\n config.experimental.enablePrerenderSourceMaps = true\n\n if (configuredExperimentalFeatures) {\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n 'enablePrerenderSourceMaps',\n true,\n 'enabled by `experimental.cacheComponents`'\n )\n }\n }\n}\n\nfunction addConfiguredExperimentalFeature<\n KeyType extends keyof ExperimentalConfig,\n>(\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[],\n key: KeyType,\n value: ExperimentalConfig[KeyType],\n reason?: string\n) {\n if (value !== (defaultConfig.experimental as Record<string, unknown>)[key]) {\n configuredExperimentalFeatures.push({ key, value, reason })\n }\n}\n\nfunction setExperimentalFeatureForDebugPrerender<\n KeyType extends keyof ExperimentalConfig,\n>(\n experimentalConfig: ExperimentalConfig,\n key: KeyType,\n value: ExperimentalConfig[KeyType],\n configuredExperimentalFeatures: ConfiguredExperimentalFeature[] | undefined\n) {\n if (experimentalConfig[key] !== value) {\n experimentalConfig[key] = value\n\n if (configuredExperimentalFeatures) {\n const action =\n value === true ? 'enabled' : value === false ? 'disabled' : 'set'\n\n const reason = `${action} by \\`--debug-prerender\\``\n\n addConfiguredExperimentalFeature(\n configuredExperimentalFeatures,\n key,\n value,\n reason\n )\n }\n }\n}\n\nfunction cloneObject(obj: any): any {\n // Primitives & null\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n // RegExp → clone via constructor\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags)\n }\n\n // Function → just reuse the function reference\n if (typeof obj === 'function') {\n return obj\n }\n\n // Arrays → map each element\n if (Array.isArray(obj)) {\n return obj.map(cloneObject)\n }\n\n // Detect non‑plain objects (class instances)\n const proto = Object.getPrototypeOf(obj)\n const isPlainObject = proto === Object.prototype || proto === null\n\n // If it's not a plain object, just return the original\n if (!isPlainObject) {\n return obj\n }\n\n // Plain object → create a new object with the same prototype\n // and copy all properties, cloning data properties and keeping\n // accessor properties (getters/setters) as‑is.\n const result = Object.create(proto)\n for (const key of Reflect.ownKeys(obj)) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key)\n\n if (descriptor && (descriptor.get || descriptor.set)) {\n // Accessor property → copy descriptor as‑is (get/set functions)\n Object.defineProperty(result, key, descriptor)\n } else {\n // Data property → clone the value\n result[key] = cloneObject(obj[key])\n }\n }\n\n return result\n}\n"],"names":["loadConfig","normalizeConfig","warnOptionHasBeenDeprecated","warnOptionHasBeenMovedOutOfExperimental","normalizeNextConfigZodErrors","error","shouldExit","issues","normalizeZodErrors","flatMap","issue","message","path","config","nestedPropertyKey","reason","silent","hasWarned","current","found","nestedPropertyKeys","split","key","undefined","Log","warnOnce","oldExperimentalKey","newKey","configFileName","experimental","warn","newKeys","length","shift","warnCustomizedOption","defaultValue","customMessage","segs","seg","assignDefaults","dir","userConfig","result","exportTrailingSlash","trailingSlash","dynamicIO","cacheComponents","Object","keys","reduce","currentConfig","value","Error","userDistDir","trim","Array","isArray","forEach","ext","defaultConfig","constructor","c","k","v","trustHostHeader","ciEnvironment","hasNextSupport","allowDevelopmentBuild","process","env","NODE_ENV","isStableBuild","ppr","CanaryOnlyError","feature","turbopackPersistentCaching","output","i18n","rewrites","redirects","headers","assetPrefix","basePath","startsWith","endsWith","amp","canonicalBase","images","localPatterns","hasMatch","some","pattern","pathname","search","push","remotePatterns","map","protocol","hostname","port","proto","replace","includes","url","URL","hasMatchForAssetPrefix","matchRemotePattern","domains","loader","imageConfigDefault","pathHasPrefix","loaderFile","absolutePath","join","existsSync","__NEXT_TEST_MODE","hasWarnedBuildActivityPosition","devIndicators","buildActivityPosition","position","outputStandalone","serverActions","bodySizeLimit","parseInt","toString","isNaN","outputFileTracingRoot","isAbsolute","resolve","turbopack","root","NEXT_DEPLOYMENT_ID","deploymentId","dset","rootDir","findRootDir","setHttpClientAndAgentOptions","hasAppDir","Boolean","findDir","i18nType","locales","defaultLocaleType","defaultLocale","invalidDomainItems","filter","item","domain","console","defaultLocaleDuplicate","find","altItem","hasInvalidLocale","locale","domainItem","JSON","stringify","invalidLocales","String","normalizedLocales","Set","duplicateLocales","localeLower","toLowerCase","has","add","size","localeDetectionType","localeDetection","allowedValues","cacheLife","defaultDefault","revalidate","expire","staleTimes","static","defaultCacheLifeProfile","stale","staticStaleTime","expireTime","cacheHandlers","allowedHandlerNameRegex","handlerKeys","invalidHandlerItems","test","handlerPath","userProvidedModularizeImports","modularizeImports","transform","lodash","userProvidedOptimizePackageImports","optimizePackageImports","htmlLimitedBots","HTML_LIMITED_BOT_UA_RE_STRING","useCache","applyModifyConfig","phase","PHASE_PRODUCTION_BUILD","PHASE_PRODUCTION_SERVER","adapterPath","adapterMod","interopDefault","pathToFileURL","require","href","modifyConfig","info","name","configCache","Map","getCacheKey","customConfig","reactProductionProfiling","debugPrerender","keyData","hasCustomConfig","djb2Hash","rawConfig","reportExperimentalFeatures","cacheKey","cachedResult","get","configuredExperimentalFeatures","__NEXT_PRIVATE_RENDER_WORKER","loadWebpackHook","err","__NEXT_PRIVATE_STANDALONE_CONFIG","standaloneConfig","parse","set","curLog","loadEnvConfig","PHASE_DEVELOPMENT_SERVER","configOrigin","findUp","CONFIG_FILES","cwd","basename","userConfigModule","envBefore","assign","transpileConfig","nextConfigPath","newEnv","updateInitialEnv","loadedConfig","freeze","TURBOPACK","addConfiguredExperimentalFeature","cloneObject","isRootProcess","send","NEXT_MINIMAL","configSchema","state","safeParse","success","messages","errorMessages","flushAndExit","target","slice","turbo","loaders","rules","entries","turbopackMemoryLimit","memoryLimit","turbopackMinify","minify","turbopackTreeShaking","treeShaking","turbopackSourceMaps","sourceMaps","useLightningcss","loadBindings","isLightningSupported","css","lightning","RegExp","source","enforceExperimentalFeatures","isDefaultConfig","completeConfig","relative","configFile","finalConfig","configBaseName","extname","unsupportedConfig","sync","clonedDefaultConfig","options","PHASE_EXPORT","setExperimentalFeatureForDebugPrerender","__NEXT_EXPERIMENTAL_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_PPR","clientSegmentCache","clientParamParsing","enablePrerenderSourceMaps","experimentalConfig","action","obj","flags","getPrototypeOf","isPlainObject","prototype","create","Reflect","ownKeys","descriptor","getOwnPropertyDescriptor","defineProperty"],"mappings":";;;;;;;;;;;;;;;;;IAkrCA,OAuZC;eAvZ6BA;;IAvoCrBC,eAAe;eAAfA,6BAAe;;IAqBRC,2BAA2B;eAA3BA;;IA2BAC,uCAAuC;eAAvCA;;;oBA3FW;sBAC4C;qBACzC;+DACX;6DACE;gEACU;2BAOxB;8BACwC;6BASf;6BACG;qBAEa;8BACnB;0BACD;mCACiB;+BACf;oCACK;iCAIH;sBACX;qBACc;uBACW;8BACtB;4BACuB;gCAChB;sBACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKzB,SAASC,6BACPC,KAA2B;IAE3B,IAAIC,aAAa;IACjB,MAAMC,SAASC,IAAAA,uBAAkB,EAACH;IAClC,OAAO;QACLE,OAAOE,OAAO,CAAC,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAE;YAChC,IAAID,MAAME,IAAI,CAAC,EAAE,KAAK,UAAU;gBAC9B,oEAAoE;gBACpEN,aAAa;YACf;YAEA,OAAOK;QACT;QACAL;KACD;AACH;AAEO,SAASJ,4BACdW,MAAkB,EAClBC,iBAAyB,EACzBC,MAAc,EACdC,MAAe;IAEf,IAAIC,YAAY;IAChB,IAAI,CAACD,QAAQ;QAC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,OAAO,CAACP,KAAM;QACtC,MAAMQ,aAAavQ,OAAOwQ,wBAAwB,CAACT,KAAKxR;QAExD,IAAIgS,cAAeA,CAAAA,WAAWzF,GAAG,IAAIyF,WAAWjF,GAAG,AAAD,GAAI;YACpD,gEAAgE;YAChEtL,OAAOyQ,cAAc,CAAC9Q,QAAQpB,KAAKgS;QACrC,OAAO;YACL,kCAAkC;YAClC5Q,MAAM,CAACpB,IAAI,GAAGmO,YAAYqD,GAAG,CAACxR,IAAI;QACpC;IACF;IAEA,OAAOoB;AACT","ignoreList":[0]}
@@ -145,7 +145,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
145
145
  }
146
146
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
147
147
  const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
148
- version: "15.4.2-canary.39"
148
+ version: "15.4.2-canary.40"
149
149
  });
150
150
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
151
151
  // of the current `next dev` invocation.
@@ -262,7 +262,7 @@ class HotReloaderWebpack {
262
262
  this.previewProps = previewProps;
263
263
  this.rewrites = rewrites;
264
264
  this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
265
- version: "15.4.2-canary.39"
265
+ version: "15.4.2-canary.40"
266
266
  });
267
267
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
268
268
  // of the current `next dev` invocation.
@@ -31,7 +31,7 @@ export declare function getImageEtag(image: Buffer): string;
31
31
  * it matches the "magic number" of known file signatures.
32
32
  * https://en.wikipedia.org/wiki/List_of_file_signatures
33
33
  */
34
- export declare function detectContentType(buffer: Buffer): Promise<string | null>;
34
+ export declare function detectContentType(buffer: Buffer, skipMetadata: boolean | null | undefined, concurrency?: number | null | undefined): Promise<string | null>;
35
35
  export declare class ImageOptimizerCache {
36
36
  private cacheDir;
37
37
  private nextConfig;
@@ -73,7 +73,7 @@ export declare function optimizeImage({ buffer, contentType, quality, width, hei
73
73
  export declare function fetchExternalImage(href: string): Promise<ImageUpstream>;
74
74
  export declare function fetchInternalImage(href: string, _req: IncomingMessage, _res: ServerResponse, handleRequest: (newReq: IncomingMessage, newRes: ServerResponse, newParsedUrl?: NextUrlWithParsedQuery) => Promise<void>): Promise<ImageUpstream>;
75
75
  export declare function imageOptimizer(imageUpstream: ImageUpstream, paramsResult: Pick<ImageParamsResult, 'href' | 'width' | 'quality' | 'mimeType'>, nextConfig: {
76
- experimental: Pick<NextConfigComplete['experimental'], 'imgOptConcurrency' | 'imgOptMaxInputPixels' | 'imgOptSequentialRead' | 'imgOptTimeoutInSeconds'>;
76
+ experimental: Pick<NextConfigComplete['experimental'], 'imgOptConcurrency' | 'imgOptMaxInputPixels' | 'imgOptSequentialRead' | 'imgOptSkipMetadata' | 'imgOptTimeoutInSeconds'>;
77
77
  images: Pick<NextConfigComplete['images'], 'dangerouslyAllowSVG' | 'minimumCacheTTL'>;
78
78
  }, opts: {
79
79
  isDev?: boolean;
@@ -235,7 +235,10 @@ async function writeToCacheDir(dir, extension, maxAge, expireAt, buffer, etag, u
235
235
  });
236
236
  await _fs.promises.writeFile(filename, buffer);
237
237
  }
238
- async function detectContentType(buffer) {
238
+ async function detectContentType(buffer, skipMetadata, concurrency) {
239
+ if (buffer.byteLength === 0) {
240
+ return null;
241
+ }
239
242
  if ([
240
243
  0xff,
241
244
  0xd8,
@@ -407,8 +410,8 @@ async function detectContentType(buffer) {
407
410
  }
408
411
  let format;
409
412
  format = (0, _detector.detector)(buffer);
410
- if (!format) {
411
- const sharp = getSharp(null);
413
+ if (!format && !skipMetadata) {
414
+ const sharp = getSharp(concurrency);
412
415
  const meta = await sharp(buffer).metadata().catch((_)=>null);
413
416
  format = meta == null ? void 0 : meta.format;
414
417
  }
@@ -847,7 +850,7 @@ async function imageOptimizer(imageUpstream, paramsResult, nextConfig, opts) {
847
850
  const { href, quality, width, mimeType } = paramsResult;
848
851
  const { buffer: upstreamBuffer, etag: upstreamEtag } = imageUpstream;
849
852
  const maxAge = Math.max(nextConfig.images.minimumCacheTTL, getMaxAge(imageUpstream.cacheControl));
850
- const upstreamType = await detectContentType(upstreamBuffer);
853
+ const upstreamType = await detectContentType(upstreamBuffer, nextConfig.experimental.imgOptSkipMetadata, nextConfig.experimental.imgOptConcurrency);
851
854
  if (!upstreamType || !upstreamType.startsWith('image/') || upstreamType.includes(',')) {
852
855
  if (!opts.silent) {
853
856
  _log.error("The requested resource isn't a valid image for", href, 'received', upstreamType);