-
I've been using next.js for a couple years and i'd say the past year or so i've had this problem of HMR and more recently fast refresh. When I load a page in the browser it doesn't hook up to fast refresh right away. If I make changes it doesn't do anything for about the first 5 minutes. Then randomly it will kick in at some point. How can I start with debugging this? NextJS: 9.5.3 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Updated screenshots: This is when I load the page and it doesn't work for a while (minutes): This is when it starts working and kicking in: |
Beta Was this translation helpful? Give feedback.
-
Do you have a leftover service-worker from another project maybe? That would generally cause issues as it does not know how to handle certain requests. |
Beta Was this translation helpful? Give feedback.
-
Just checked and there are no service works for the domain. |
Beta Was this translation helpful? Give feedback.
-
I think I may have actually tracked down the source. so I use traefik as a reverse proxy. I think that may be causing the issue. I'm going to dive into it more and see if I can pinpoint why and where. |
Beta Was this translation helpful? Give feedback.
-
The issue is related to compression:
Having gzip compression enabled was causing the issue. For traefik that config is here (https://docs.traefik.io/middlewares/compress/). Turning it off fixes the issue. |
Beta Was this translation helpful? Give feedback.
The issue is related to compression:
Having gzip compression enabled was causing the issue. For traefik that config is here (https://docs.traefik.io/middlewares/compress/).
Turning it off fixes the issue.