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 4.0 support #81

Open
enisbudancamanak opened this issue Jan 23, 2025 · 19 comments
Open

Tailwindcss 4.0 support #81

enisbudancamanak opened this issue Jan 23, 2025 · 19 comments

Comments

@enisbudancamanak
Copy link

enisbudancamanak commented Jan 23, 2025

Hey I used to begin my usual routine:

  • ddev start
  • and then the tailwind build watch command

this is the output it generated me, additionally the tailwind classes doesn't apply anymore.

Image

What am I doing wrong?

@enisbudancamanak
Copy link
Author

@ryckblick you have the same problem as me?

@kbond
Copy link
Contributor

kbond commented Jan 23, 2025

Tailwindcss 4.0 was just released. Wondering if that's the problem. If you lock the cli version to 3.x, does that work?

@ryckblick
Copy link

ryckblick commented Jan 23, 2025

@enisbudancamanak yes. My guess was the same as @kbond so I came here to see if anybody has already opened an issue.

some basic tailwind css get's generated e.g. positioning classes but everything else is missing. Not sure if it is not detecting the templates anymore. But it looks like that to me.

But that would be way above my symfony-twig-tailwind skills, so I'm lingering here... :)

@enisbudancamanak
Copy link
Author

Tailwindcss 4.0 was just released. Wondering if that's the problem. If you lock the cli version to 3.x, does that work?

interesting point, how can we lock that to 3.x?

@kbond
Copy link
Contributor

kbond commented Jan 23, 2025

See https://symfony.com/bundles/TailwindBundle/current/index.html#using-a-different-binary-version

@enisbudancamanak
Copy link
Author

enisbudancamanak commented Jan 23, 2025

@kbond you are my hero today!

Reconstruction to fix:

  • Followed the link and created a new file (config/packages/symfonycasts_tailwind.yaml)

  • File looks like this:
    symfonycasts_tailwind: binary_version: 'v3.3.0'

  • after that I also reverted the version in the composer.json for: "symfonycasts/tailwind-bundle": "^0.6.1" (from 0.7.0)

  • ddev composer install

  • ddev stop and also ddev start

voilà it worked again! Thank you so much! Shall we close this issue?

@enisbudancamanak
Copy link
Author

@ryckblick Let us know if it worked for you!

@ryckblick
Copy link

@kbond same here. Thanks a ton!

I just did the yaml-part and did not touch the composer.json
Got the message that "caniuse-lite is outdated" but that's (basically) all.

@enisbudancamanak
Copy link
Author

@ryckblick good to know that it worked without reverting the version, amazing cooperation here! Thank y'all! ❤

@ryckblick
Copy link

Shall we close this issue?

I think the issue itself still persists. So maybe keep it open?

@enisbudancamanak enisbudancamanak changed the title Watchman not found Watchman not found [Solution] Jan 23, 2025
@kbond
Copy link
Contributor

kbond commented Jan 23, 2025

Yeah,let's keep this open. We need to get 4.0 working with this bundle.

After that I also reverted the version in the composer.json for: "symfonycasts/tailwind-bundle": "^0.6.1" (from 0.7.0)

This shouldn't be required actually.

@kbond kbond changed the title Watchman not found [Solution] Tailwindcss 4.0 support Jan 23, 2025
@fracsi
Copy link
Contributor

fracsi commented Jan 23, 2025

@kbond same here. Thanks a ton!

I just did the yaml-part and did not touch the composer.json Got the message that "caniuse-lite is outdated" but that's (basically) all.

Lock to v3.4.17 - this is the latest v3 version afaik.

@stof
Copy link

stof commented Jan 23, 2025

Apparently, the èinit' command does not exist anymore in the tailwindcss CLI in version 4 (without any mention in the release notes or the upgrade guide), so tailwind:init is also broken with v4 right now.

@stof
Copy link

stof commented Jan 23, 2025

@kbond until v4 is supported, maybe the bundle should be updated to download latest 3.x by default instead of downloading 4.0

@kbond
Copy link
Contributor

kbond commented Jan 23, 2025

I was thinking this also. I'll create a PR soon

@barbieswimcrew
Copy link
Contributor

I upgraded my website https://www.hoamatbeat.com to tailwind 4 today using your package. Works perfectly... just sayin'

@kbond
Copy link
Contributor

kbond commented Jan 23, 2025

@barbieswimcrew, curious, was there anything specific you needed to configure to make 4.0 work?

Trying to get an understanding of what's needed - for instance, the 4.0 release has different binaries.

@barbieswimcrew
Copy link
Contributor

@kbond its some hours ago but if i remember right i just did

bin/console tailwind:build -w

First there was an error... something like "binary can't be found... tailwind latest whatever" but when I tried again it downloaded the v4 binary and ran through properly.

I deploy my code on commit by using buddy.io where a pipeline action executes the tailwind:build command again... again no errors. Just like plug n play.

But I of course didn't do tailwind:init because the project already existed. Check the css on my website it's commented with tailwind v4 so that's the proof🙃

@barbieswimcrew
Copy link
Contributor

Hey I used to begin my usual routine:

  • ddev start
  • and then the tailwind build watch command

this is the output it generated me, additionally the tailwind classes doesn't apply anymore.

Image

What am I doing wrong?

But you know that Tailwind v4 has got some breaking changes that need to be resolved? The tailwind.config.js won't be detected automatically. Check https://tailwindcss.com/docs/upgrade-guide#using-a-javascript-config-file

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

No branches or pull requests

6 participants