QueryFn is by default on pause and not executed
Hello, for me it works, however for my work colleague on mac using the same node version and chrome version we get different results. We are not using any cache provider, but somehow the query is not executed for him and marked as paused. For me it is executed without issue (on Ubuntu). What could be reasons for that?
The hook looks like this:
Here is how we use the provider:
6 Replies
stormy-goldOP•3y ago
the useDocuments hook returns the following object:
Okay I found out why, it seems when we set
networkMode to always then it works, is here maybe currently a bug with checking the connection on macs (with chrome)?stormy-goldOP•3y ago
So it seems that this is being used to detect online status https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine
Navigator: onLine property - Web APIs | MDN
Returns the online status of the browser. The property returns a boolean value, with
true meaning online and false meaning offline. The property
sends updates whenever the browser's ability to connect to the network changes. The
update occurs when the user follows links or when a script requests a remote page. For
example, the property s...
stormy-goldOP•3y ago
not sure if this is an issue on chrome and mac, since it works for him with using safari
extended-salmon•3y ago
it's a chrome bug that forced me to do this for v5: https://github.com/TanStack/query/pull/5714
I hate it, but what can you do 🤷♂️
GitHub
fix(onlineManager): always initialize with
online: true by TkDodo...instead of relying on navigator.onLine, because that indicator is broken AF in chrome
https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online
stormy-goldOP•3y ago
Okay so there is no workaround only setting the networkMode to always helps?
extended-salmon•3y ago
upgrade to v5?