You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: @plugin "flyonui" breaks with @tailwindcss/vite 4.2.4 — resolves to flyonui.css instead of index.js #144
After upgrading @tailwindcss/vite from 4.2.2 to 4.2.4, the Vite dev server throws the following error:
Unknown file extension ".css" for .../node_modules/flyonui/flyonui.css
Plugin: @tailwindcss/vite:generate:serve
File: src/css/main.css
Root cause:
@tailwindcss/vite 4.2.4 changed how it resolves @plugin directives — it now uses Vite's browser-aware resolver instead of plain Node.js resolution.
flyonui's package.json declares both a main and a browser field:
"main": "./index.js",
"browser": "./flyonui.css"
Vite's resolver honors the browser field, so @plugin "flyonui" resolves to flyonui.css instead of index.js. Node.js then fails trying to dynamically import() a .css file as an ES module.
Workaround:
Explicitly reference the JS entry point in the @plugin directive:
@plugin "flyonui" should resolve to the JS plugin (index.js), not the CSS bundle (flyonui.css).
Suggested fix:
The cleanest fix on flyonui's side would be to add a proper exports map in package.json with a tailwind-plugin or default condition pointing to index.js, so that @tailwindcss/vite's resolver always gets the JS entry regardless of the browser field:
Thank you for your support in helping us improve FlyonUI!
We’ve received your submission and will respond within few business days. Our team handles issues one at a time, and we’ll be reviewing yours as soon as possible.
In the meantime, any additional details or a reproducible example would be greatly appreciated and will help us resolve the issue more efficiently.
This issue appears to be related to recent changes in Tailwind CSS (v4+) and its Vite integration, which have introduced breaking changes in how CSS files and plugins are handled.
Thank you for sharing this solution. Explicitly referencing the JavaScript entry point using:
@plugin "flyonui/index.js" {
themes: all;
}
is a valid and effective workaround(As you have suggested).
As the root cause appears to stem from recent changes on the Tailwind CSS side, this approach can be used safely until an official fix is released. In the meantime, either this method or the insiders build suggested earlier are both reasonable options depending on your setup.
I was making my app in vue 3 and flyonui and i got the same bug
Console log:
✗ Build failed in 22.27s
error during build:
Build failed with 1 error:[plugin vite:css] /home/Pretexto2/node_modules/.pnpm/flyonui@2.4.1/node_modules/flyonui/flyonui.css:1:87368
SyntaxError: [lightningcss] Unexpected token CurlyBracketBlock
at aggregateBindingErrorsIntoJsError (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/error-B8po7KiL.mjs:48:18)
at unwrapBindingResult (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/error-B8po7KiL.mjs:18:128)
at #build (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/rolldown-build-9MccaWPU.mjs:3236:34)
at async buildEnvironment (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33137:64)
at async Object.build (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33559:19)
at async Object.buildApp (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33556:153)
at async CAC. (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/cli.js:777:3) {
errors: [Getter/Setter]
}
ELIFECYCLE Command failed with exit code 1.
ERROR: "build-only" exited with 1.
ELIFECYCLE Command failed with exit code 1.
I use pnpm 9
Vue 3.5.32
Tw 4.3.0
Vite 8.0.8
Ts 6
Flyon 2.4.1
I applied the same solution of "flyon/index.js" and insider version and it didn't work for me
I was making my app in vue 3 and flyonui and i got the same bug
Console log:
✗ Build failed in 22.27s
error during build:
Build failed with 1 error:[plugin vite:css] /home/Pretexto2/node_modules/.pnpm/flyonui@2.4.1/node_modules/flyonui/flyonui.css:1:87368
SyntaxError: [lightningcss] Unexpected token CurlyBracketBlock
at aggregateBindingErrorsIntoJsError (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/error-B8po7KiL.mjs:48:18)
at unwrapBindingResult (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/error-B8po7KiL.mjs:18:128)
at #build (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/rolldown-build-9MccaWPU.mjs:3236:34)
at async buildEnvironment (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33137:64)
at async Object.build (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33559:19)
at async Object.buildApp (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33556:153)
at async CAC. (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/cli.js:777:3) {
errors: [Getter/Setter]
}
ELIFECYCLE Command failed with exit code 1.
ERROR: "build-only" exited with 1.
ELIFECYCLE Command failed with exit code 1.
I use pnpm 9 Vue 3.5.32 Tw 4.3.0 Vite 8.0.8 Ts 6 Flyon 2.4.1 I applied the same solution of "flyon/index.js" and insider version and it didn't work for me
This appears to be a different issue from the one reported previously. The earlier issue was related to Tailwind CSS Vite, which has already been resolved.
Based on the error logs you shared, we are currently unable to determine the root cause of the problem. Could you please provide a minimal reproduction example or the steps required to reproduce the issue?
I was making my app in vue 3 and flyonui and i got the same bug
Console log:
✗ Build failed in 22.27s
error during build:
Build failed with 1 error:[plugin vite:css] /home/Pretexto2/node_modules/.pnpm/flyonui@2.4.1/node_modules/flyonui/flyonui.css:1:87368
SyntaxError: [lightningcss] Unexpected token CurlyBracketBlock
at aggregateBindingErrorsIntoJsError (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/error-B8po7KiL.mjs:48:18)
at unwrapBindingResult (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/error-B8po7KiL.mjs:18:128)
at #build (file:///home/Pretexto2/node_modules/.pnpm/rolldown@1.0.2/node_modules/rolldown/dist/shared/rolldown-build-9MccaWPU.mjs:3236:34)
at async buildEnvironment (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33137:64)
at async Object.build (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33559:19)
at async Object.buildApp (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/chunks/node.js:33556:153)
at async CAC. (file:///home/Pretexto2/node_modules/.pnpm/vite@8.0.14_@types+node@24.12.4_jiti@2.7.0_less@4.6.4_yaml@2.9.0/node_modules/vite/dist/node/cli.js:777:3) {
errors: [Getter/Setter]
}
ELIFECYCLE Command failed with exit code 1.
ERROR: "build-only" exited with 1.
ELIFECYCLE Command failed with exit code 1.
I use pnpm 9 Vue 3.5.32 Tw 4.3.0 Vite 8.0.8 Ts 6 Flyon 2.4.1 I applied the same solution of "flyon/index.js" and insider version and it didn't work for me
This appears to be a different issue from the one reported previously. The earlier issue was related to Tailwind CSS Vite, which has already been resolved.
Based on the error logs you shared, we are currently unable to determine the root cause of the problem. Could you please provide a minimal reproduction example or the steps required to reproduce the issue?
~Best regards,
Hello, here how i got that bug
Create vue project and install flyonui and tailwind 4
Use of flyonui lib
Build with pnpm build
That's how i got the bug, I don't think if another lib affects i checked the file that appears on the log and it actually has that sintaxis error for some reason.
I hope this is helpful.
Activity
github-actions commentedon May 4, 2026
Thank you for your support in helping us improve FlyonUI!
We’ve received your submission and will respond within few business days. Our team handles issues one at a time, and we’ll be reviewing yours as soon as possible.
In the meantime, any additional details or a reproducible example would be greatly appreciated and will help us resolve the issue more efficiently.
Thank you for your patience and understanding!
yagnikvamja commentedon May 5, 2026
Hello @areski ,
This issue appears to be related to recent changes in Tailwind CSS (v4+) and its Vite integration, which have introduced breaking changes in how CSS files and plugins are handled.
For more detailed context, you can refer to the official discussion here: tailwindlabs/tailwindcss#19950
As a temporary workaround, the Tailwind team has suggested using an insiders version of the Vite plugin. You can install it with:
This version includes fixes that address the current compatibility issues.
~Best regards,
areski commentedon May 5, 2026
For me it was simply fixed by changing the directive:
To:
yagnikvamja commentedon May 5, 2026
Hello,
Thank you for sharing this solution. Explicitly referencing the JavaScript entry point using:
is a valid and effective workaround(As you have suggested).
As the root cause appears to stem from recent changes on the Tailwind CSS side, this approach can be used safely until an official fix is released. In the meantime, either this method or the insiders build suggested earlier are both reasonable options depending on your setup.
Appreciate you taking the time to highlight this.
~Best regards,
Gabskit commentedon Jun 4, 2026
I got same problem
I was making my app in vue 3 and flyonui and i got the same bug
I use pnpm 9
Vue 3.5.32
Tw 4.3.0
Vite 8.0.8
Ts 6
Flyon 2.4.1
I applied the same solution of "flyon/index.js" and insider version and it didn't work for me
yagnikvamja commentedon Jun 9, 2026
Hello @Gabskit ,
This appears to be a different issue from the one reported previously. The earlier issue was related to Tailwind CSS Vite, which has already been resolved.
Based on the error logs you shared, we are currently unable to determine the root cause of the problem. Could you please provide a minimal reproduction example or the steps required to reproduce the issue?
~Best regards,
Gabskit commentedon Jun 10, 2026
Hello, here how i got that bug
That's how i got the bug, I don't think if another lib affects i checked the file that appears on the log and it actually has that sintaxis error for some reason.
I hope this is helpful.