-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 fails to resolve font URLs in external packages with Vite #16700
Comments
Git patch to get the reproduction to run properly:diff --git a/app.css b/app.css
index 4dddaa0..f022ffc 100644
--- a/app.css
+++ b/app.css
@@ -1,18 +1,10 @@
-@import '@fortawesome/fontawesome-pro/css/fontawesome' layer(base);
-@import '@fortawesome/fontawesome-pro/css/brands' layer(base);
-@import '@fortawesome/fontawesome-pro/css/duotone' layer(base);
-@import '@fortawesome/fontawesome-pro/css/regular' layer(base);
-@import '@fortawesome/fontawesome-pro/css/solid' layer(base);
-@import '@fortawesome/fontawesome-pro/css/light' layer(base);
+@import '@fortawesome/fontawesome-free/css/fontawesome' layer(base);
+@import '@fortawesome/fontawesome-free/css/brands' layer(base);
+@import '@fortawesome/fontawesome-free/css/regular' layer(base);
+@import '@fortawesome/fontawesome-free/css/solid' layer(base);
-@import '../../vendor/wire-elements/pro/resources/css/tailwind/overlay-component.css'
- layer(base);
-@import '../../vendor/wire-elements/pro/resources/css/tailwind/insert-component.css'
- layer(base);
@import 'tailwindcss';
-@config '../../tailwind.config.js';
-
@layer base {
*,
diff --git a/package.json b/package.json
index ef8ea4f..ff3f4d7 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"vite": "^6.0.0"
},
"dependencies": {
- "@fortawesome/fontawesome-pro": "^6.6.0",
+ "@fortawesome/fontawesome-free": "^6.6.0",
"@fullcalendar/moment": "^6.1.15",
"flatpickr": "^4.6.13",
"fullcalendar-scheduler": "^6.1.15",
diff --git a/vite.config.js b/vite.config.js
index 5b72368..bc65573 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -6,8 +6,7 @@ export default defineConfig({
plugins: [
laravel({
input: [
- 'resources/css/app.css',
- 'resources/js/app.js',
+ 'app.css',
],
refresh: true,
}), |
@DonCamillo11 Thanks for setting this up, the repro is really good and helpful! You were right though that is the same issue when you said you're using "Vite" I thought this happens for you using the Vite integration but you are indeed also using the PostCSS extension. Going to merge this back into the other issue I just sent you from 😬 Sorry! |
@philipp-spiess sorry, my fault 🙇 |
@DonCamillo11 Nah that's on me, thank you for providing the repro! |
@philipp-spiess I have an issue that feels directly related to this one, but I was hoping to run it by you to get a sense of whether I should open another issue, provide my own reproduction here, etc. My situation is as follows:
My file structure has @font-face {
font-family: "Source Code Pro";
src:
url("fonts/sourcecodepro-regular.woff2") format("woff2"),
url("fonts/sourcecodepro-regular.woff") format("woff");
font-weight: 400;
font-style: normal;
} ( The actual font files are in @font-face {
font-family: "Source Code Pro";
src:
url("./src/fonts/sourcecodepro-regular.woff2") format("woff2"),
url("./src/fonts/sourcecodepro-regular.woff") format("woff");
font-weight: 400;
font-style: normal;
} I saw in #16636 you said this:
From that it sounds like these Thanks for all your work on this—much appreciated! |
Sorry, @philipp-spiess — after rereading everything today, I now understand that this behaviour is intentional, via #16965. Would you be open to a pull request allowing |
What version of Tailwind CSS are you using?
v4.0.6
What build tool (or framework if it abstracts the build tool) are you using?
Vite 6.1.1
What version of Node.js are you using?
v22.13.0
What browser are you using?
Safari
What operating system are you using?
macOS
Reproduction URL
https://github.com/DonCamillo11/tailwind-bug
Describe your issue
I try to import fontawesome pro in my app.css. When running npm run build I get the following errors:
It was working with Tailwind v3
but after updating my Laravel application to Tailwind 4 there seem to be a problem building the files.
The text was updated successfully, but these errors were encountered: