Infinite Compile Loop When Using next-pwa
(service worker) with TailwindCSS v4
#16776
-
What version of Tailwind CSS are you using? v4.0.6 What build tool (or framework if it abstracts the build tool) are you using? Next.js 15.1.7 What version of Node.js are you using? v22.12.0 What browser are you using? Firefox and Chrome What operating system are you using? macOS and Linux Reproduction URL Github : https://github.com/amirsinaa/tailwindcss4-sw-bug -- Description: Hello, When I export my Next.js configuration with
However, if I export my Next.js config without I dug deeper into this issue and found that when the service worker is enabled, removing the Additional Notes:
Any insights or potential fixes would be greatly appreciated! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey! I took a look at your repro. What's happening is that the Two ideas on how you could fix this:
|
Beta Was this translation helpful? Give feedback.
Hey! I took a look at your repro. What's happening is that the
next-pwa
addon seems to write files into yourpublic/
folder for every compile.public/
is not part of your.gitignore
and so the files inside that directory are going to be scanned for Tailwind CSS candidates and so sincenext-pwa
updates the last write time every time, this in turn will notify Tailwind CSS to do a new compilation which seems to again triggernext-pwa
to update the last write times, etc.Two ideas on how you could fix this:
public
folder to gitignore (I thinkpublic/*.js
should do that?)publi…