Skip to content

3.4.2 introduced breaking change with PR #12715 #13383

@nodegin

Description

@nodegin

What version of Tailwind CSS are you using?

3.4.2

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

PostCSS 8.4.35 Vite 5.1.5

What version of Node.js are you using?

v21.6.2

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

Sorry I don't have reproduction as the repo is my company private repo.

Describe your issue

f2a7c2c#diff-e52d7cbb53c2deb88bfe15cfc210a387853cf9f243172b6e2844bb88bc9743a3R115

In this change, a regex replace was added to manipulate the file path.
After some research, I found this regex will try to add backslash to parentheses.

    // Escape special characters in the file path such as: ()[]
    // But only if the special character isn't already escaped
    console.log("filePath before", filePath);
    filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, "\\$1");
    console.log("filePath after", filePath);

# console log below
filePath before /Users/user/Desktop/project/apps/web/src/**/*!(*.stories|*.spec).tsx
filePath after /Users/user/Desktop/project/apps/web/src/**/*!\(*.stories|*.spec\).tsx

However this line breaks my entire project, I am getting this error:

2024-03-28 3 29 30

By commenting this line, I don't get any warning anymore and my styles can be processed now.

2024-03-28 3 32 21 2024-03-28 3 32 44

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