{"record":{"id":"2d1a4819bc14cade","repo":"tailwindlabs/tailwindcss","slug":"unexpected-plugin-option-value-of-declaration","errorCode":null,"errorMessage":"Unexpected `@plugin` option: Value of declaration `${toCss([decl]).trim()}` is not supported.\n\nUsing an object as a plugin option is currently only supported in JavaScript configuration files.","messagePattern":"Unexpected `@plugin` option: Value of declaration `(.+?)` is not supported\\.\n\nUsing an object as a plugin option is currently only supported in JavaScript configuration files\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwindcss/src/compat/apply-compat-hooks.ts","lineNumber":101,"sourceCode":"\n        let parts = segment(value, ',').map((part) => {\n          part = part.trim()\n\n          if (part === 'null') {\n            return null\n          } else if (part === 'true') {\n            return true\n          } else if (part === 'false') {\n            return false\n          } else if (!Number.isNaN(Number(part))) {\n            return Number(part)\n          } else if (\n            (part[0] === '\"' && part[part.length - 1] === '\"') ||\n            (part[0] === \"'\" && part[part.length - 1] === \"'\")\n          ) {\n            return part.slice(1, -1)\n          } else if (part[0] === '{' && part[part.length - 1] === '}') {\n            throw new Error(\n              `Unexpected \\`@plugin\\` option: Value of declaration \\`${toCss([decl]).trim()}\\` is not supported.\\n\\nUsing an object as a plugin option is currently only supported in JavaScript configuration files.`,\n            )\n          }\n\n          return part\n        })\n\n        options[decl.property] = parts.length === 1 ? parts[0] : parts\n      }\n\n      pluginPaths.push([\n        {\n          id: pluginPath,\n          base: ctx.context.base as string,\n          reference: !!ctx.context.reference,\n          src: node.src,\n        },\n        Object.keys(options).length > 0 ? options : null,","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/tailwindlabs/tailwindcss/blob/16e94cbf7f965c5ad697e90e940b5e178efad67c/packages/tailwindcss/src/compat/apply-compat-hooks.ts#L83-L119","documentation":"Thrown when parsing a `@plugin` option declaration whose value starts with `{` and ends with `}` — i.e. an object literal. CSS `@plugin` options only support JSON primitives (null, bool, number, quoted string); object values require a JavaScript config file. The full declaration is echoed via `toCss([decl]).trim()`.","triggerScenarios":"Writing `@plugin \"x.js\" { config: { key: value } }`. The part-wise parser hits the `{...}` branch and rejects it.","commonSituations":"Migrating a JS plugin config that uses nested option objects into CSS `@plugin` syntax; assuming CSS plugin options mirror the JS object shape.","solutions":["Move that plugin's configuration into a JS/TS config file (`tailwind.config.js`) where object options are supported.","Flatten the object into primitive declarations the plugin can read, if the plugin accepts that shape.","Use `plugin.withOptions()` and pass options from JS instead of CSS `@plugin`."],"exampleFix":"// before (CSS)\n@plugin \"./my-plugin.js\" {\n  theme: { primary: \"#f00\" };\n}\n// after (tailwind.config.js)\nplugins: [require(\"./my-plugin.js\")({ theme: { primary: \"#f00\" } })]","handlingStrategy":"validation","validationCode":"function assertNoObjectOption(node) {\n  for (const decl of node.nodes ?? []) {\n    const v = (decl.value ?? '').trim();\n    if (v[0] === '{' && v[v.length - 1] === '}') {\n      throw new Error(`Object option ${decl.property} not supported in CSS @plugin; use JS config`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep object-shaped plugin options in a JS config file; pass primitives only via CSS `@plugin`.","Document per-plugin whether its options are CSS-compatible."],"tags":["tailwind","plugin","config","css-options"],"backgroundTag":null,"analyzedSha":"16e94cbf7f965c5ad697e90e940b5e178efad67c","analyzedAt":"2026-08-12T06:02:42.469Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}