{"record":{"id":"fe71aab4650c719c","repo":"vercel/next.js","slug":"experimental-csschunking-graph-is-only-suppor","errorCode":null,"errorMessage":"`experimental.cssChunking: \"graph\"` is only supported with Turbopack. Please remove the option or run Next.js with Turbopack in ${configFileName}.","messagePattern":"`experimental\\.cssChunking: \"graph\"` is only supported with Turbopack\\. Please remove the option or run Next\\.js with Turbopack in (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":521,"sourceCode":"    result.sassOptions &&\n    'functions' in result.sassOptions\n  ) {\n    throw new Error(\n      `The \"sassOptions.functions\" option is not supported when using Turbopack. ` +\n        `Custom Sass functions are only available with webpack. ` +\n        `Please remove the \"functions\" property from your sassOptions in ${configFileName}.`\n    )\n  }\n\n  // Validate experimental.cssChunking compatibility with the active bundler. Graph mode is\n  // Turbopack-only; strict mode and `false` (single-chunk-per-module) are webpack-only.\n  // Only validate during build/dev — `next start` doesn't pick a bundler and would otherwise\n  // see `process.env.TURBOPACK` unset and reject a valid `cssChunking: \"graph\"` config.\n  if (phase !== PHASE_PRODUCTION_SERVER && phase !== PHASE_INFO) {\n    const cssChunkingValue = result.experimental.cssChunking\n    const cssChunkingMode = resolveCssChunkingMode(cssChunkingValue)\n    if (cssChunkingMode === 'graph' && !process.env.TURBOPACK) {\n      throw new Error(\n        `\\`experimental.cssChunking: \"graph\"\\` is only supported with Turbopack. ` +\n          `Please remove the option or run Next.js with Turbopack in ${configFileName}.`\n      )\n    }\n    if (cssChunkingMode === 'strict' && process.env.TURBOPACK) {\n      throw new Error(\n        `\\`experimental.cssChunking: \"strict\"\\` is only supported with webpack. ` +\n          `Please remove the option or run Next.js with webpack in ${configFileName}.`\n      )\n    }\n    // Only error when `false` was set explicitly. `undefined` (the default) also resolves to\n    // `'off'` but that's the implicit default and must not error on Turbopack.\n    if (cssChunkingValue === false && process.env.TURBOPACK) {\n      throw new Error(\n        `\\`experimental.cssChunking: false\\` is only supported with webpack. ` +\n          `Please remove the option or run Next.js with webpack in ${configFileName}.`\n      )\n    }","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L503-L539","documentation":"`experimental.cssChunking: \"graph\"` produces bundle-graph-aware CSS chunks, a strategy only implemented for Turbopack. If the value resolves to 'graph' but Turbopack is not active (`process.env.TURBOPACK` unset), normalization throws. Note this check is skipped during `next start` (PHASE_PRODUCTION_SERVER) and PHASE_INFO since no bundler is chosen then.","triggerScenarios":"Setting `experimental: { cssChunking: 'graph' }` and running `next build`/`next dev` with webpack (`--webpack` or default where Turbopack isn't engaged).","commonSituations":"Adopting CSS chunking graph mode after reading docs written for Turbopack, then running a webpack build. Forcing webpack in CI while keeping Turbopack-only options.","solutions":["Run with Turbopack (remove `--webpack`) to use graph mode","Switch to a webpack-compatible cssChunking value: omit it (default) or use a webpack-supported mode"],"exampleFix":"// before\n// next build --webpack\nmodule.exports = { experimental: { cssChunking: 'graph' } }\n// after (option A)\nmodule.exports = { experimental: { cssChunking: 'graph' } }\n// run: next build  (Turbopack)\n// after (option B)\nmodule.exports = { experimental: { cssChunking: 'strict' } }\n// run: next build --webpack","handlingStrategy":"validation","validationCode":"const isTurbopack = Boolean(process.env.TURBOPACK)\nif (cssChunking === 'graph' && !isTurbopack) {\n  cssChunking = undefined // or switch bundler\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate cssChunking on the active bundler before setting it","Document which cssChunking modes each bundler supports in the config"],"tags":["config","css","turbopack","bundlers","experimental"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}