{"record":{"id":"857c099b3715b5e7","repo":"vercel/next.js","slug":"process-env-next-deployment-id-is-missing-but-runt-857c09","errorCode":null,"errorMessage":"process.env.NEXT_DEPLOYMENT_ID is missing but runtimeServerDeploymentId is enabled","messagePattern":"process\\.env\\.NEXT_DEPLOYMENT_ID is missing but runtimeServerDeploymentId is enabled","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/route-modules/route-module.ts","lineNumber":599,"sourceCode":"        'Invariant: getNextConfigEdge must only be called in edge runtime'\n      )\n    }\n\n    let serverFilesManifest = self.__SERVER_FILES_MANIFEST as any as\n      | RequiredServerFilesManifest\n      | undefined\n    const routerServerContext = this.getRouterServerContext(req)\n    const nextConfig =\n      routerServerContext?.nextConfig || serverFilesManifest?.config\n\n    if (!nextConfig) {\n      throw new Error(\"Invariant: nextConfig couldn't be loaded\")\n    }\n\n    let deploymentId\n    if (nextConfig.experimental?.runtimeServerDeploymentId) {\n      if (!process.env.NEXT_DEPLOYMENT_ID) {\n        throw new Error(\n          'process.env.NEXT_DEPLOYMENT_ID is missing but runtimeServerDeploymentId is enabled'\n        )\n      }\n      deploymentId = process.env.NEXT_DEPLOYMENT_ID\n    } else {\n      deploymentId = nextConfig.deploymentId || ''\n    }\n\n    return { nextConfig, deploymentId }\n  }\n\n  public prepare(\n    req: IncomingMessage | BaseNextRequest,\n    res: ServerResponse | null,\n    options: {\n      srcPage: string\n      multiZoneDraftMode?: boolean\n    }","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/vercel/next.js/blob/43273a1d21a35646ec43230e05727e18ac258396/packages/next/src/server/route-modules/route-module.ts#L581-L617","documentation":"Thrown in getNextConfigEdge while resolving config for an edge route module: experimental.runtimeServerDeploymentId is enabled in the loaded next config, but the NEXT_DEPLOYMENT_ID environment variable was not present/inlined when the edge bundle was built. Edge bundles read config from the server files manifest, so the deployment id the feature requires is simply missing from the environment.","triggerScenarios":"runtimeServerDeploymentId is enabled but NEXT_DEPLOYMENT_ID is unset.","commonSituations":"Route module initialization requires the deployment id env var that was not provided.","solutions":["Set NEXT_DEPLOYMENT_ID in the environment, or disable runtimeServerDeploymentId."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"43273a1d21a35646ec43230e05727e18ac258396","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}