We are having a problem with one of our third party libraries (cube.js) triggering fast refresh. We know it's definitely this library causing the problem because it only started after we added it, and the problem goes away once we remove the library. However, we don't know exactly where the problem is happening. I'm hoping to find out how to both a) turn on some kind of debug log for fast refresh that can tell us WHY a full-page reload was triggered and then b) how to configure fast refresh so that this doesn't happen anymore.
#Live refresh - how to debug / configure?
25 messages · Page 1 of 1 (latest)
there's some basic docs out there explaining what fast refresh is but I'm not finding a whole lot about how to work with it / refine it
yeah afaik theres not much documented about it. I think next only triggers the fast refresh if the source files are saved, so I am not sure why a library would trigger a refresh
@lunar narwhal Do you have a code sample that I could try to replicate?
well, I was sorta hoping to just find out how to debug, not let someone else debug. I'm not allowed to just share our repo and it takes time to build a perfect reproduction repo
but I can work on that if you're saying you think you know how to track this down
I can try to replicate it on my side too, are you using the app directory or /pages ?
pages
yeah something tells me it's not just installing that package on its own that causes the problem. I'm sure something else we're doing on our end must cause the behavior, I just don't know what and it's sorta a large haystack to comb through
I'll work on a repo, if I can get something small to reproduce I'll send it your way. Thanks for writing back 😉
Are you using getServerSideProps or in a useEffect?
no getServerSideProps.
I mean we have lots of hook usage across the app but this seems to happen on every page so it's hard to narrow down
ie, all I have to do is go to a portion of the app that hasn't been compiled yet, and once that part of the app is compiled, all instances of the app will refresh
which also means, I never get routed to the new page I just compiled, so I have to click it again
My thought is, it's not actually a hot reload but the component (or page for some reason?) unmounting and reloading
oh
does it make some kind of cache folder?
I could believe the remounting being an issue but then why on several tabs at once
it does
but I've moved that cache folder out, and I'm still getting the refreshes on compile
which is where I'm like, what other files is it modifying
but I don't see them
If you preserve logs in the other open tabs, does it show anything in the console or on the network?