next-safe-actionplayground
Overview
  • Home
Core
  • Core Actions
  • Validation Errors
  • Middleware
Hooks
  • React Hooks
  • Optimistic Updates
  • Coordinating Mutations
  • Pending Changes
Integrations
  • Form Integration
  • React Hook Form
  • TanStack Query
Framework
  • Navigation & Framework
  • Offline Support
  • GitHub

Offline Support

Experimental Next.js recovery for interrupted Server Actions and prefetched navigation.

Offline Server Action
Start the action while offline. Next.js keeps it pending and completes it automatically after reconnection.

State: Idle

No result yet.
Prefetched App Shell
Keep this link visible while online so Next.js can prefetch the destination App Shell.
Open offline destination
Test It
  1. Load this page online and keep the destination link visible until it is prefetched.
  2. Go offline, then run the action. It stays pending and reports the offline state.
  3. Reconnect. The action completes without another click and shows the server result.
  4. Go offline again and open the destination. Its shell and offline fallback render from the prefetch.
  5. Reconnect to stream the request-time section into the destination.

Current limitation: if you start the mutation offline and then click the destination link, the request-time navigation content waits on the same connection as the action. The prefetched shell can render, and both requests complete after reconnection.

A full reload while offline is not supported because this demo does not install a service worker.