{"record":{"id":"0e68058bc6ae380c","repo":"vercel/next.js","slug":"the-sassoptions-functions-option-is-not-supporte","errorCode":null,"errorMessage":"The \"sassOptions.functions\" option is not supported when using Turbopack. Custom Sass functions are only available with webpack. Please remove the \"functions\" property from your sassOptions in ${configFileName}.","messagePattern":"The \"sassOptions\\.functions\" option is not supported when using Turbopack\\. Custom Sass functions are only available with webpack\\. Please remove the \"functions\" property from your sassOptions in (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":506,"sourceCode":"    }\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  // Validate sassOptions.functions is not used with Turbopack\n  if (\n    process.env.TURBOPACK &&\n    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      )","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L488-L524","documentation":"Turbopack does not implement custom Sass functions (the `sassOptions.functions` API), which is a webpack/sass-only feature. When `process.env.TURBOPACK` is set and `functions` is present in sassOptions, config normalization throws, pointing at the config file name. This prevents silent loss of the custom functions.","triggerScenarios":"Setting `sassOptions: { functions: { ... } }` and running `next dev`/`next build` with Turbopack (default bundler in this version). Detected by checking `process.env.TURBOPACK`.","commonSituations":"Upgrading to a Next.js version where Turbopack is the default. Migrating a project that relied on custom Dart Sass functions for theme color math. Using a shared sassOptions object across webpack and Turbopack projects.","solutions":["Remove the `functions` property from sassOptions when using Turbopack","Move the logic that needed custom functions into a preprocessor step (e.g. a build script that generates SCSS), or into CSS variables / JS","Run with webpack instead: `next build --webpack` (only if custom functions are essential)"],"exampleFix":"// before\nmodule.exports = {\n  sassOptions: { functions: { 'myColor($c)': (c) => c } }\n}\n// after\nmodule.exports = {\n  sassOptions: { includePaths: ['./styles'] }\n}","handlingStrategy":"validation","validationCode":"const isTurbopack = Boolean(process.env.TURBOPACK)\nif (isTurbopack && sassOptions?.functions) {\n  delete sassOptions.functions // or migrate the logic\n}","typeGuard":"const hasSassFunctions = (o: unknown): o is { functions: Record<string, unknown> } =>\n  typeof o === 'object' && o !== null && 'functions' in o","tryCatchPattern":null,"preventionTips":["Keep Turbopack and webpack configs separate, or strip sassOptions.functions conditionally","Migrate custom Sass functions to CSS variables or a preprocessor"],"tags":["config","sass","turbopack","bundlers"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}