Open nahtnam opened 7 months ago
Hello, You are encountering an issue with Tailwind CSS 3.4.1 and Next.js 14.2.1 where class names like prose-sm, prose-lg, or prose-xl are not being generated unless you restart the server. This issue seems to be related to the presence of a symlink in your project directory.
Here are a few steps you can try to resolve this issue:
Check Tailwind Configuration: Ensure that your tailwind.config.js is correctly set up to include the paths where your classes are used. Sometimes, symlinks can cause paths to be misinterpreted. Update Dependencies: Make sure all your dependencies are up to date. Sometimes, issues are resolved in newer versions of the tools you’re using. Symlink Handling: Since removing the symlink seems to resolve the issue, you might want to avoid using symlinks in your project if possible. Alternatively, you can look into configuring your build tool to handle symlinks more gracefully. Tailwind JIT Mode: If you’re not already using it, consider enabling JIT mode in Tailwind CSS. JIT mode can sometimes handle dynamic class generation more efficiently. File Watching: Ensure that your development server is correctly watching all files, including those accessed my ford benefits via symlinks. You might need to adjust your file watching settings.
I can confirm that symlinks in the watch directory still trip up HMR on the latest versions of the following dependencies:
next
: 15.0.1
react
and react-dom
: 18.3.1
or 19.0.0-rc-65a56d0e-20241020
postcss
: 8.4.47
tailwindcss
: 3.4.14
What version of Tailwind CSS are you using?
3.4.1
What build tool (or framework if it abstracts the build tool) are you using?
Next.js 14.2.1 with tailwind 3.4.1
What version of Node.js are you using?
v20.9.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://github.com/nahtnam/tailwind-symlink-bug
Describe your issue
prose-sm
,prose-lg
, orprose-xl
. It will not generate the class name. If you restart the server it does. You can also do something likepy-[100px]
src/app/(symlink)
(which contains a symlink)