{"record":{"id":"a1235e1929643412","repo":"vercel/next.js","slug":"the-target-property-is-no-longer-supported-in","errorCode":null,"errorMessage":"The \"target\" property is no longer supported in ${configFileName}.\nSee more info here https://nextjs.org/docs/messages/deprecated-target-config","messagePattern":"The \"target\" property is no longer supported in (.+?)\\.\nSee more info here https://nextjs\\.org/docs/messages/deprecated-target-config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":2104,"sourceCode":"\n    // Always validate the config against schema in non minimal mode\n    if (!process.env.NEXT_MINIMAL && !silent) {\n      await validateConfigSchema(\n        userConfig,\n        configFileName,\n        curLog.warn,\n        (messages) => {\n          // Capture validation messages for MCP error reporting\n          if (messages.length > 0) {\n            const fullMessage = messages.join('\\n')\n            NextInstanceErrorState.nextConfig.push(new Error(fullMessage))\n          }\n        }\n      )\n    }\n\n    if ((userConfig as any).target && (userConfig as any).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 (reactProductionProfiling) {\n      userConfig.reactProductionProfiling = reactProductionProfiling\n    }\n\n    if (\n      userConfig.experimental?.lightningCssFeatures &&\n      !userConfig.experimental?.useLightningcss &&\n      bundler !== Bundler.Turbopack\n    ) {\n      curLog.warn(\n        `experimental.lightningCssFeatures is set but experimental.useLightningcss is not enabled. ` +\n          `The lightningCssFeatures option has no effect without useLightningcss.`\n      )","sourceCodeStart":2086,"sourceCodeEnd":2122,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L2086-L2122","documentation":"Thrown at config.ts:2103 when `target` is present and not equal to `'server'`. The `target` config option (e.g. `'serverless'`) was removed from Next.js; the check allows `'server'` for backward compatibility but any other value throws. The error links to the deprecated-target-config docs.","triggerScenarios":"`module.exports = { target: 'serverless' }`; `{ target: 'experimental-serverless-trace' }`; `{ target: 'edge' }`.","commonSituations":"Upgrading from Next.js 11/12 where `target: 'serverless'` was used for Vercel-style deployments; old tutorials recommending `target`.","solutions":["Remove the `target` property entirely — modern Next.js defaults to the supported server output.","If you relied on serverless output, use the `output: 'standalone'` or `output: 'export'` option instead, as appropriate."],"exampleFix":"// before\nmodule.exports = { target: 'serverless' }\n// after\nmodule.exports = {} // target removed; or use output: 'standalone' if you need a self-contained build","handlingStrategy":"validation","validationCode":"if (config.target !== undefined && config.target !== 'server') {\n  throw new Error('target is no longer supported');\n}","typeGuard":"function targetIsAllowed(c: any): boolean {\n  return c.target === undefined || c.target === 'server';\n}","tryCatchPattern":null,"preventionTips":["Remove `target` from configs upgraded from Next.js <= 12.","Use `output: 'standalone'` for self-contained builds instead."],"tags":["config","deprecation","migration"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}