Nuxt · Hydration & SSR

NUXT0060useState values must be serializable

Report unsupported live values stored in Nuxt payload state.

Why it happens

Nuxt serializes payload state with devalue, which supports Map, Set, Date, and RegExp values. Functions and live sockets cannot be transferred to the client as payload state.

Fix

Use values supported by Nuxt's payload serializer, or keep live resources outside payload state.

Example

Keep useState serializable

Before

const socket = useState('socket', () => new WebSocket('wss://example.com'))

After

const socketUrl = useState('socket-url', () => 'wss://example.com')

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm nuxt doctor --rules nuxt/state/no-nonserializable-usestate
Copyright © 2026