{"record":{"id":"1e4d347bcac25cac","repo":"tailwindlabs/tailwindcss","slug":"error-in-the-config-file-plugin-preset-an-empty-p","errorCode":null,"errorMessage":"Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.","messagePattern":"Error in the config file/plugin/preset\\. An empty preset \\(`preset: \\[\\]`\\) is not currently supported\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwindcss/src/compat/config/resolve-config.ts","lineNumber":162,"sourceCode":"      // Happens with `plugin.withOptions()` when no options were passed:\n      // e.g. `require(\"my-plugin\")` instead of `require(\"my-plugin\")(options)`\n      plugins.push({ ...plugin(), reference, src })\n    } else if ('handler' in plugin) {\n      // Happens with `plugin(…)`:\n      // e.g. `require(\"my-plugin\")`\n      //\n      // or with `plugin.withOptions()` when the user passed options:\n      // e.g. `require(\"my-plugin\")(options)`\n      plugins.push({ ...plugin, reference, src })\n    } else {\n      // Just a plain function without using the plugin(…) API\n      plugins.push({ handler: plugin, reference, src })\n    }\n  }\n\n  // Apply configs from presets\n  if (Array.isArray(config.presets) && config.presets.length === 0) {\n    throw new Error(\n      'Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.',\n    )\n  }\n\n  for (let preset of config.presets ?? []) {\n    extractConfigs(ctx, { path, base, config: preset, reference, src })\n  }\n\n  // Apply configs from plugins\n  for (let plugin of plugins) {\n    ctx.plugins.push(plugin)\n\n    if (plugin.config) {\n      extractConfigs(ctx, {\n        path,\n        base,\n        config: plugin.config,\n        reference: !!plugin.reference,","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/tailwindlabs/tailwindcss/blob/16e94cbf7f965c5ad697e90e940b5e178efad67c/packages/tailwindcss/src/compat/config/resolve-config.ts#L144-L180","documentation":"Thrown in `resolve-config.ts` when `config.presets` is an array of length zero. Tailwind v4 treats an explicitly empty `presets: []` as a distinct (and unsupported) intent — disabling all presets via an empty array is not implemented. The guard fires before iterating presets.","triggerScenarios":"Writing `module.exports = { presets: [] }` to try to disable default presets. `Array.isArray(config.presets) && config.presets.length === 0` is true.","commonSituations":"Migrating a v3 config that set `presets: []` to opt out of defaults; attempting to start from a blank slate.","solutions":["Remove the `presets: []` key entirely so Tailwind uses its default behavior.","If you want a custom preset set, provide at least one preset entry in the array.","Override individual theme keys directly instead of trying to clear presets."],"exampleFix":"// before (tailwind.config.js)\nmodule.exports = { presets: [] }\n// after\nmodule.exports = {} // or omit the presets key","handlingStrategy":"validation","validationCode":"function assertPresetsValid(config) {\n  if (Array.isArray(config.presets) && config.presets.length === 0) {\n    throw new Error('presets: [] is unsupported; omit the key instead');\n  }\n}\n// assertPresetsValid(config);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit the `presets` key rather than setting it to an empty array.","Add a migration codemod that strips `presets: []`."],"tags":["tailwind","presets","config","v3-migration"],"backgroundTag":null,"analyzedSha":"16e94cbf7f965c5ad697e90e940b5e178efad67c","analyzedAt":"2026-08-12T06:02:42.469Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}