{"record":{"id":"292025f0cc60fb17","repo":"tailwindlabs/tailwindcss","slug":"config-cannot-have-a-body","errorCode":null,"errorMessage":"`@config` cannot have a body.","messagePattern":"`@config` cannot have a body\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwindcss/src/compat/apply-compat-hooks.ts","lineNumber":129,"sourceCode":"\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,\n      ])\n\n      features |= Features.JsPluginCompat\n      return WalkAction.Replace([])\n    }\n\n    // Collect paths from `@config` at-rules\n    if (node.name === '@config') {\n      if (node.nodes.length > 0) {\n        throw new Error('`@config` cannot have a body.')\n      }\n\n      if (ctx.parent !== null) {\n        throw new Error('`@config` cannot be nested.')\n      }\n\n      configPaths.push({\n        id: node.params.slice(1, -1),\n        base: ctx.context.base as string,\n        reference: !!ctx.context.reference,\n        src: node.src,\n      })\n      features |= Features.JsPluginCompat\n      return WalkAction.Replace([])\n    }\n  })\n\n  registerLegacyUtilities(designSystem)","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/tailwindlabs/tailwindcss/blob/16e94cbf7f965c5ad697e90e940b5e178efad67c/packages/tailwindcss/src/compat/apply-compat-hooks.ts#L111-L147","documentation":"Thrown when an `@config` at-rule has any child nodes (`node.nodes.length > 0`). `@config` only takes a path argument; it cannot have a body. The check runs before the nesting check.","triggerScenarios":"Writing `@config \"./tw.js\" { /* anything */ }`. Even an empty `{}` block produces a node list that fails this guard.","commonSituations":"Confusing `@config` with `@plugin` (which can take option declarations); leftover braces after deleting content.","solutions":["Remove the block: `@config \"./tw.js\";` with no braces.","If you intended to pass plugin options, switch to `@plugin` with declarations or a JS config."],"exampleFix":"// before\n@config \"./tailwind.config.js\" {\n  /* empty */\n}\n// after\n@config \"./tailwind.config.js\";","handlingStrategy":"validation","validationCode":"function assertConfigNoBody(node) {\n  if (node.name === '@config' && node.nodes.length > 0) {\n    throw new Error('@config cannot have a body');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write `@config \"path\";` as a single line to avoid accidental braces.","Reserve braces for `@plugin` options, not `@config`."],"tags":["tailwind","config","at-rule","syntax"],"backgroundTag":null,"analyzedSha":"16e94cbf7f965c5ad697e90e940b5e178efad67c","analyzedAt":"2026-08-12T06:02:42.469Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}