Capítulo 59 de 80
Controls how TanStack Query decides "is this a server or browser runtime" — override it only for non-standard runtimes (extension workers, edge functions) where the default check would misclassify the environment.
isServer(): returns whether the current runtime is currently treated as server-side — by default, delegates to query-core's exported isServer utility.setIsServer(fn): replaces the detection function entirely with a custom () => boolean — e.g. () => typeof window === 'undefined' && !('chrome' in globalThis) to distinguish a real server from a browser-extension worker (which also lacks window but shouldn't be treated as "server").environmentManager.setIsServer(() => isServer) re-establishes the built-in check.environmentManager.setIsServer(() => typeof window === 'undefined' && !('chrome' in globalThis))
window, but has chrome) from being misclassified as server environments.gcTime, getQueryClient() patterns in Advanced Server Rendering).environmentManager.isServer() used directly in the getQueryClient() pattern.