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

Fix: pin tailwindcss to version 3 in artisan command make:filament-theme #15479

Merged

Conversation

bachacode
Copy link
Contributor

Description

Before the changes the artisan command make:filament-theme would install the latest tailwindcss version which is the 4.0.0 at the current date, this would create an incompatibility as filament 3 uses tailwindcss 3 and there are some breaking changes in the syntax and plugins of this newest version of tailwindcss.

Trying to run npm run build or npm run dev with tailwindcss 4.0.0 installed would result in an error like this:

[vite:css] Failed to load PostCSS config (searchPath: D:/folder/subfolder/filament-project): [Error] Loading PostCSS Plugin failed: Package subpath './nesting' is not defined by "exports" in D:\folder\subfolder\filament-project\node_modules\tailwindcss\package.json

Error: Loading PostCSS Plugin failed: Package subpath './nesting' is not defined by "exports" in D:\folder\subfolder\filament-project\node_modules\tailwindcss\package.json

(@D:\folder\subfolder\filament-project\postcss.config.js)
    at load (file:///D:/folder/subfolder/filament-project/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:33602:11)       
    at file:///D:/folder/subfolder/filament-project/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:33627:16
    at Array.map (<anonymous>)
    at plugins (file:///D:/folder/subfolder/filament-project/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:33626:8)     
    at processResult (file:///D:/folder/subfolder/filament-project/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:33696:14)
    at file:///D:/folder/subfolder/filament-project/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:33826:14
file: D:\folder\subfolder\filament-project\resources\css\filament\admin\theme.css

Functional changes

  • Updated the artisan command make:filament-theme to explicitly install tailwindcss@3
  • Ensures compatibility and avoids potential breaking changes from future versions

…heme"

- Updated the install command to explicitly use tailwindcss@3
- Ensures compatibility and avoids potential breaking changes from future versions
@danharrin danharrin added the enhancement New feature or request label Jan 31, 2025
@danharrin danharrin added this to the v3 milestone Jan 31, 2025
@danharrin danharrin merged commit 113f280 into filamentphp:3.x Jan 31, 2025
@danharrin
Copy link
Member

Thanks!

@DanjBethel
Copy link

does this mean I cannot currently use themes with v4 of tailwind? This seems to break some very popular filament plugins which really on themes, currently having an issue with Curator.

@danharrin

@danharrin
Copy link
Member

Tailwind 4 has a host of breaking changes that need to be addressed in the next major version of Filament (v4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants