Skip to content

"Invalid declaration" error when import has semicolon #16188

@NoahStahl

Description

@NoahStahl

What version of Tailwind CSS are you using?

v4.0.3

What build tool (or framework if it abstracts the build tool) are you using?

@tailwindcss/cli 4.0.3

What version of Node.js are you using?

v22.13.1

What browser are you using?

Chrome

What operating system are you using?

Windows

Describe your issue

Following the installation instructions docs for CLI, step two is to create a css file with content:

@import "tailwindcss";

When I do this an run the build command in step 3, it fails with error:

Error: Invalid declaration: `@import "tailwindcss"`

However, when I remove the semicolon on the import line, build succeeds. This avoids the error:

@import "tailwindcss"

** Expected behavior **

The semicolon should be optional, or the CLI should not fail when it is provided as documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions