Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TailwindCSS > 3.1.8 in linux doesn't resolve content paths correctly #9763

Closed
leokolezhuk opened this issue Nov 7, 2022 · 4 comments · Fixed by #9787
Closed

TailwindCSS > 3.1.8 in linux doesn't resolve content paths correctly #9763

leokolezhuk opened this issue Nov 7, 2022 · 4 comments · Fixed by #9787
Assignees

Comments

@leokolezhuk
Copy link

leokolezhuk commented Nov 7, 2022

What version of Tailwind CSS are you using?
3.2.2

What build tool (or framework if it abstracts the build tool) are you using?
vue 3.2.41, vue-cli 5.0.8, webpack 5.74.0

What version of Node.js are you using?
tested on16, 18, it is irrelevant.

What browser are you using?

Irrelevant

What operating system are you using?

Ubuntu, Windows 10

Reproduction URL

Can provide if requested.

Describe your issue
When using latest tailwindcss, content resolution behavior is broken in Linux.

I have a project with the following tree structure. Notice there are two .ce.vue files where actual tailwind classes are present.
image
The tailwind.config.js is the following:
image

When project is built with vue-cli under Windows 10, tailwind css classes are extracted correctly.
When doing the same under Ubuntu, no tailwind css classes are extracted.
Downgrading to tailwind 3.1.8 resolved this issue. Therefore, I believe it is an issue with tailwindcss.

@thecrypticace thecrypticace self-assigned this Nov 7, 2022
@thecrypticace
Copy link
Contributor

thecrypticace commented Nov 7, 2022

Could you share the full path on linux to one of your content files?

@leokolezhuk
Copy link
Author

Hi @thecrypticace ,

Thanks for having a look at this.
Below is the full path to the tailwind.config.js file:

  • Ubuntu: /home/lk/fc-vector/src/Vector.Configuration.Spa/tailwind.config.js

@thecrypticace
Copy link
Contributor

Hey, thanks for reporting this. Comically enough this was a lurking bug even in 3.1 that only revealed itself if your content paths were specified using absolute paths (for instance if you're using path.resolve). We switched to using absolute paths in a bunch of places internally for consistency reasons and it broke this. Basically, because your main .vue file had @tailwind directives in it we wouldn't pick it up for changes.

We do some normalization on paths in one case but not another which is why this bug didn't appear on Windows because the path separator is switched after normalization.

This should be available to test via our insiders build in a few minutes: npm install tailwindcss@insiders

Thanks for reporting the bug! This one was an interesting one to track down haha.

@leokolezhuk
Copy link
Author

That was probably the quickest bug fix in the history of open source! Thanks a lot, @thecrypticace!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants