{"record":{"id":"dca4e1e2178aacc0","repo":"vercel/swr","slug":"fallback-data-is-required-when-using-suspense-in-s","errorCode":null,"errorMessage":"Fallback data is required when using Suspense in SSR.","messagePattern":"Fallback data is required when using Suspense in SSR\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/index/use-swr.ts","lineNumber":931,"sourceCode":"\n  // Display debug info in React DevTools.\n  useDebugValue(returnedData)\n\n  // In Suspense mode, we can't return the empty `data` state.\n  // If there is an `error`, the `error` needs to be thrown to the error boundary.\n  // If there is no `error`, the `revalidation` promise needs to be thrown to\n  // the suspense boundary.\n  if (suspense) {\n    // SWR should throw when trying to use Suspense on the server with React 18,\n    // without providing any fallback data. This causes hydration errors. See:\n    // https://github.com/vercel/swr/issues/1832\n    if (\n      !IS_REACT_LEGACY &&\n      IS_SERVER &&\n      hasKeyButNoData &&\n      isUndefined(preloadedData)\n    ) {\n      throw new Error('Fallback data is required when using Suspense in SSR.')\n    }\n\n    // Always update fetcher and config refs even with the Suspense mode.\n    if (hasKeyButNoData) {\n      fetcherRef.current = fetcher\n      configRef.current = config\n      unmountedRef.current = false\n    }\n\n    const shouldConsumePreload = !isUndefined(preloadedData) && hasKeyButNoData\n    let preloadData = UNDEFINED as Data | undefined\n\n    if (shouldConsumePreload && hasCacheData) {\n      preloadData =\n        preloadedData && isPromiseLike(preloadedData)\n          ? use(preloadedData)\n          : preloadedData\n      data = preloadData","sourceCodeStart":913,"sourceCodeEnd":949,"githubUrl":"https://github.com/vercel/swr/blob/7173e55b2a175dee455612c5fa067383345c392f/src/index/use-swr.ts#L913-L949","documentation":"Error \"Fallback data is required when using Suspense in SSR.\" thrown in vercel/swr.","triggerScenarios":"Thrown at src/index/use-swr.ts:931 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7173e55b2a175dee455612c5fa067383345c392f","analyzedAt":"2026-08-27T20:47:56.280Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}