Solution for Missing Tailwind CSS Class Autocompletion in Vite + React Projects on PyCharm

Hello,

Following up on support ticket number #7215656, I had previously submitted some feedback regarding a potential cause related to CPU issues (i9-14KF). At the time, after switching the CPU, Tailwind CSS autocompletion inside PyCharm started working again and everything was fine. However, after some time, the issue came back, and I’m not sure if it might be related to the project’s size or structure.

That said, I’ve recently discovered another possible and, in my opinion, more plausible cause.

The issue was occurring in a project using Vite + React with Tailwind CSS >4. The autocompletion would stop working — the suggestion popup would appear, but no Tailwind classes were listed.

After many, many frustrating attempts, I found that during development, if you manually include the <link> tag to the CSS file (the one containing @import "tailwindcss";) inside the index.html file — specifically where React mounts the "root" div — Tailwind class autocompletion immediately starts working again, without needing to restart anything.

Apparently, this is necessary because during development, the CSS file is not directly referenced in the HTML but instead imported through the React JSX files.

WITH ❤️ from ROME

0

Please sign in to leave a comment.