This reproduction shows an issue in @tailwindcss/vite@^4.0.8 that breaks the candidates search when the config file (css) is loaded from a package.
In @tailwindcss/[email protected] it works because it uses the Module Graph to find the candidates, but it was replaced with a FS based system in this PR tailwindcss#16631.
- run
pnpm dev, open the preview a check that the button is loading with Tailwind styles applied. - in the
package.json, replace"@tailwindcss/vite": "4.0.7"with"@tailwindcss/vite": "4.0.9"and runpnpm i. - run
pnpm dev, now the button does not have styles applied.
- Theorically, this could be fixed by using
@source, but as seen innode_modules/@ialdama/tailwind-config/styles.css, it does not work. - This is probably caused by pnpm dependencies structure, as the css file is not really loading from
node_modules/@ialdama/tailwind-config/styles.cssbut rathernode_modules/.pnpm/@[email protected]/node_modules/@ialdama/tailwind-config/styles.css.