tailwindlabs/tailwindcss · error · Error

Error in the config file/plugin/preset. The `content` key co

Error message

Error in the config file/plugin/preset. The `content` key contains a `raw` entry:

${JSON.stringify(file, null, 2)}

This feature is not currently supported.

What it means

Thrown while importing `content.files` from a resolved JS config into the v4 source pipeline. The v4 design system scans filesystem globs, so `content.raw` entries (inline content strings) from v3 are unsupported. The offending entry is JSON-stringified so the user can locate it.

Source

Thrown at packages/tailwindcss/src/compat/apply-compat-hooks.ts:413

      let ctx = cssContext(_ctx)

      // The AST node was already manually wrapped so there's nothing to do
      if (ctx.parent?.kind === 'rule' && ctx.parent.selector === wrappingSelector) {
        return WalkAction.Stop
      }

      return WalkAction.ReplaceStop(styleRule(wrappingSelector, [node]))
    })
  }

  for (let candidate of resolvedConfig.blocklist) {
    designSystem.invalidCandidates.add(candidate)
  }

  for (let file of resolvedConfig.content.files) {
    if ('raw' in file) {
      throw new Error(
        `Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry:\n\n${JSON.stringify(file, null, 2)}\n\nThis feature is not currently supported.`,
      )
    }

    let negated = false
    if (file.pattern[0] == '!') {
      negated = true
      file.pattern = file.pattern.slice(1)
    }
    sources.push({ ...file, negated })
  }
  return features
}

View on GitHub (pinned to 16e94cbf7f)

Solutions

  1. Remove the `raw` entries from `content` in your config; rely on glob patterns (`content: ['./src/**/*.{html,js}']`).
  2. If you need inline content scanning, write the markup to a temporary file and add its path to `content.files`.
  3. Switch fully to the v4 CSS-first config and drop the JS `content` key.

Example fix

// before (tailwind.config.js)
module.exports = {
  content: {
    files: ['./src/**/*.html'],
    raw: [{ content: '<div class="p-4"></div>' }],
  },
}
// after
module.exports = {
  content: ['./src/**/*.html'],
}
Defensive patterns

Strategy: validation

Validate before calling

function assertNoRawContent(config) {
  for (const f of config.content?.files ?? []) {
    if (typeof f === 'object' && 'raw' in f) {
      throw new Error('content.raw is unsupported in v4');
    }
  }
}
// assertNoRawContent(resolvedConfig);

Prevention

When it happens

Trigger: A v3 config with `content: { files: [...], raw: [{ content: '<div class="p-4">' }] }` loaded via `@config` or a JS plugin. The loop hits `'raw' in file` and rejects it.

Common situations: Migrating a v3 config verbatim; plugin/preset that injects raw content entries; tooling that programmatically builds content arrays with raw blobs.

Related errors


AI-assisted analysis of tailwindlabs/tailwindcss@16e94cbf7f (2026-08-12). Data as JSON: /api/errors/ca7ea11134e163fa. Report an issue: GitHub.