-
Notifications
You must be signed in to change notification settings - Fork 218
Error: Tailwind CSS: Cannot read properties of undefined (reading 'type') #1362
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
Comments
This appears to be happening because we're parsing |
Ah okay so its caused by this line:
I don't think Culori is supposed to throw on invalid color parsing ever but I'll wrap things so catch the error. |
Ah, I see now. But shouldn't it get override by what the user input or at least should throw an error? |
This is more about how we resolve colors. It has to do a recursive lookup on the design system in case someone did something like this:
If we see This definitely shouldn't cause IntelliSense to just break tho. I've got a fix for this in #1363. |
I see. |
Fixes #1362 Basically when we'd see `rgb(1rem)` and tried to parse it with Culori it would throw an error instead of returning `undefined` as would normally be the case. Pretty sure this isn't supposed to throw but 🤷♂️
I'm aiming to get a release out this week (maybe tomorrow or Thursday) with a bunch of fixes so this fix will be released soon. Thanks for reporting it 👍 |
Uh oh!
There was an error while loading. Please reload this page.
What version of Tailwind CSS are you using?
v4.1.6
What build tool (or framework if it abstracts the build tool) are you using?
Astro 5.7.12, React 19.1.0
What version of Node.js are you using?
v22.15.0
What browser are you using?
EDGE, FireFox (not relevant to the issue)
What operating system are you using?
Windows 11 24H2 IoT LTSC (not relevant to the issue)
Reproduction URL
https://github.com/ehsan18t/tw-bug-repo
Describe your issue
I don't get any suggestions from intellisense at all. I tried so many things to fix it but didn't work at all. I get errors on output tab in vscode (attached below). After change things here and there in
src/styles/global.css
it goes away but suggestion still doesn't work most of the time. But again, sometimes it does. If I remove everything from @theme and everything under it, everything starts working. I checked multiple time if anything is wrong with theme but it's not (according to official docs).EDIT:
OK, I've just found out if I don't use
rgb()
inside@theme
everything works. Even though usingrgb()
doesn't give any error on the tailwindcss side and works perfectly but intellisense doesn't work. I've addedglobal-works.css
, removingglobal.css
file and replacing it insidesrc/layouts/MainLayout.astro
make the intellisense works perfectly.The text was updated successfully, but these errors were encountered: