T
TanStack12mo ago
ugly-tan

?url import of css file fails, but straight import of css file with same filepath works

Within my tanstack start project I've followed the same setup as displayed in the start basic example. However when calling a ?url import I get the following error in console:
Uncaught SyntaxError: The requested module '/_build/app/styles/tailwind.css?url' does not provide an export named 'default' (at root.tsx:6:8)
Uncaught SyntaxError: The requested module '/_build/app/styles/tailwind.css?url' does not provide an export named 'default' (at root.tsx:6:8)
18 Replies
ugly-tan
ugly-tanOP12mo ago
The above only seems to happen when using the @tailwindcss/vite plugin
itchy-amethyst
itchy-amethyst12mo ago
can you please provide a minimal complete example by forking one of the existing examples on stackblitz?
ugly-tan
ugly-tanOP12mo ago
Oh for sure!
ugly-tan
ugly-tanOP12mo ago
Jesse Koldewijn
StackBlitz
Router Start Basic Example (forked) - StackBlitz
Run official live example code for Router Start Basic, created by Tanstack on StackBlitz
ugly-tan
ugly-tanOP12mo ago
Although stackblitz doesn't seem to allow native binding like the oxide engine inside tailwind v4 (which is where the above mentioned plugin is necessary for)
itchy-amethyst
itchy-amethyst12mo ago
i'll run it locally so which route does produce this error?
ugly-tan
ugly-tanOP12mo ago
I was trying to just add the tailwind css as a url onto the __root route
itchy-amethyst
itchy-amethyst12mo ago
so this is not there yet? what do I have to do?
ugly-tan
ugly-tanOP12mo ago
The code for it would be there, but somewhere within tanstack's handling of vite it seems to provide a incorrect output for the ?url import
itchy-amethyst
itchy-amethyst12mo ago
the root route does not import that css though? oh it imports app.css
ugly-tan
ugly-tanOP12mo ago
yes which is a tailwindcss v4 entry file
itchy-amethyst
itchy-amethyst12mo ago
ok but I don't see the error you pasted in your first message ah in the browser console now I got it sorry
ugly-tan
ugly-tanOP12mo ago
yes, sorry should have clarified!
itchy-amethyst
itchy-amethyst12mo ago
GitHub
[v4] Something has broken since alpha.15, causing imports in CSS fi...
What version of Tailwind CSS are you using? v4.0.0-alpha.25 What build tool (or framework if it abstracts the build tool) are you using? vite 5.4.8 What version of Node.js are you using? bun 1.1.27...
itchy-amethyst
itchy-amethyst12mo ago
if you downgrade to 4.0.0-alpha.14 it works
harsh-harlequin
harsh-harlequin12mo ago
4.0.0-alpha.15 works
No description
harsh-harlequin
harsh-harlequin12mo ago
No description
itchy-amethyst
itchy-amethyst11mo ago
GitHub
[v4] Something has broken since alpha.15, causing imports in CSS fi...
What version of Tailwind CSS are you using? v4.0.0-alpha.25 What build tool (or framework if it abstracts the build tool) are you using? vite 5.4.8 What version of Node.js are you using? bun 1.1.27...

Did you find this page helpful?