-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Fast Refresh had to perform a full reload. #48
Comments
Yeah this is an age-old issue, but I have not investigated it. Sounds like something is being unexpectedly cached, though. |
It seems to only occur in dev, so maybe I could disable the SW in dev if I'm not working on it. |
Since Next' preloading etc. behaves differently in dev mode, I found it best to only test the SW in production build. const withSerwist = require("@serwist/next").default({
swSrc: "./sw.ts",
swDest: "public/sw.js",
disable: process.env.NODE_ENV === 'development',
}); That solves the issue for me, feel free to close. |
@timohausmann no, let's keep it open. Dev mode is supported, and as such, we will need it to work properly. This clearly causes it to not. |
I get the same issue, also added |
@Xardasus if you use runtimeCaching: process.env.NODE_ENV === "development" ? undefined : defaultCache, This feature can cause JS assets to be accidentally outdated, which is not something you want in development mode. You may also clear the caches just in case. In Serwist v9, Hope this helps! |
Many thanks @DuCanhGH, looks like it's working |
Provide environment information
Using next.js 14 and pages router, running
npm run dev
, following the docs, I get endless loops of refreshs. It says in the node console:It does not happen on the first request, but when I hit CTRL+R once.
Any idea what could be the issue / why it's refreshing the page endlessly?
Which project is this issue for?
@serwist/next
Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster
on demand
To reproduce
(I just upgraded from next 13 to 14 to use this lib, I hope that is not the issue, everything else seem to work normally)
npm run dev
Describe the bug
Endless loop of browser reload and the warning (see above)
Expected behavior
No endless refresh loop.
Screenshots (if relevant)
No response
Additional information (if relevant)
No response
The text was updated successfully, but these errors were encountered: