## TL;DR

Upgrade your Nhost JS SDKs (@nhost/nextjs, @nhost/react) to the release containing the fix. Intermittent 'JWT token expired' errors in Next.js SSR (both client and server, with getNhostSession) were an SDK bug in the token refresh path, already fixed upstream.

## Steps

1. Intermittent 'JWT token expired' errors in Next.js SSR (both client and server, with getNhostSession) were an SDK bug in the token refresh path, already fixed upstream. Upgrade your Nhost JS SDKs (@nhost/nextjs, @nhost/react) to the release containing the fix. If you're pinned to an old version and see random auth expiry under SSR, update first before debugging your session code.

2. _Source: https://github.com/nhost/nhost/issues/2348 (Nhost)_

## When to use

Use this skill when you run into "Next.js SSR: intermittent JWT token expired errors".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/nhost/nhost/issues/2348
