Skip to content

Infinite Compile Loop When Using next-pwa (service worker) with TailwindCSS v4 #16776

Answered by philipp-spiess
amirsinaa asked this question in Help
Discussion options

You must be logged in to vote

Hey! I took a look at your repro. What's happening is that the next-pwa addon seems to write files into your public/ 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 since next-pwa updates the last write time every time, this in turn will notify Tailwind CSS to do a new compilation which seems to again trigger next-pwa to update the last write times, etc.

Two ideas on how you could fix this:

  1. Add the auto-generated files inside your public folder to gitignore (I think public/*.js should do that?)
  2. Specify which parts Tailwind CSS should scan for components by updating the publi…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@amirsinaa
Comment options

Answer selected by amirsinaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #16763 on February 24, 2025 15:08.