{"record":{"id":"2599e838b2358c34","repo":"facebook/react","slug":"missing-getserversnapshot-which-is-required-for-s","errorCode":null,"errorMessage":"Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.","messagePattern":"Missing getServerSnapshot, which is required for server-rendered content\\. Will revert to client rendering\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFizzHooks.js","lineNumber":628,"sourceCode":"  throw new Error(\n    \"A function wrapped in useEffectEvent can't be called during rendering.\",\n  );\n}\n\nexport function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(\n  callback: F,\n): F {\n  // $FlowFixMe[incompatible-type]\n  return throwOnUseEffectEventCall;\n}\n\nfunction useSyncExternalStore<T>(\n  subscribe: (() => void) => () => void,\n  getSnapshot: () => T,\n  getServerSnapshot?: () => T,\n): T {\n  if (getServerSnapshot === undefined) {\n    throw new Error(\n      'Missing getServerSnapshot, which is required for ' +\n        'server-rendered content. Will revert to client rendering.',\n    );\n  }\n  return getServerSnapshot();\n}\n\nfunction useDeferredValue<T>(value: T, initialValue?: T): T {\n  resolveCurrentlyRenderingComponent();\n  return initialValue !== undefined ? initialValue : value;\n}\n\nfunction unsupportedStartTransition() {\n  throw new Error('startTransition cannot be called during server rendering.');\n}\n\nfunction useTransition(): [\n  boolean,","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFizzHooks.js#L610-L646","documentation":"useSyncExternalStore requires a third argument (getServerSnapshot) whenever the component can render on the server: during SSR there is no external store to subscribe to, so React needs a deterministic value to render. When the argument is missing, Fizz throws this error and the framework falls back to client rendering (or the SSR request fails).","triggerScenarios":"useSyncExternalStore(subscribe, getSnapshot) — two arguments — inside any component that gets server-rendered; older store bindings (zustand/redux/jotai) that do not forward a server snapshot internally; components reading window/document/location-derived stores during SSR.","commonSituations":"React 18 upgrades surfacing store code that never SSR'd before; third-party hooks calling useSyncExternalStore without the third argument; components using browser-only external state rendered in a server component tree.","solutions":["Pass the third argument with a deterministic server value: useSyncExternalStore(subscribe, getSnapshot, () => initialState)","Upgrade the store library/binding to an SSR-aware version that supplies getServerSnapshot (react-redux v8+, zustand v4+)","If no meaningful server value exists, render a loading shell on the server and read the store only after hydration"],"exampleFix":"// before\nconst width = useSyncExternalStore(subscribeWindow, () => window.innerWidth); // throws on server\n\n// after\nconst width = useSyncExternalStore(\n  subscribeWindow,\n  () => window.innerWidth,\n  () => 0 // deterministic server snapshot\n);","handlingStrategy":"fallback","validationCode":"// Wrapper that refuses the two-argument form before SSR can hit it.\nfunction useServerSafeSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n  if (!getServerSnapshot) {\n    throw new Error('getServerSnapshot is required for SSR — pass a deterministic server value');\n  }\n  return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the third getServerSnapshot argument when a component can render on the server","Upgrade store bindings to SSR-aware versions (react-redux v8+, zustand v4+)","For browser-only values, render a deterministic shell on the server and read the store after hydration"],"tags":["hooks","usesyncexternalstore","ssr","external-store","hydration"],"backgroundTag":"missing-getserversnapshot","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}