Skip to content

[3.x] Skip the ModalRoot request interceptor during SSR - #288

Open
gigerIT wants to merge 1 commit into
inertiaui:3.xfrom
gigerIT:fix/vue-ssr-request-interceptor
Open

gigerIT wants to merge 1 commit into
inertiaui:3.xfrom
gigerIT:fix/vue-ssr-request-interceptor

Conversation

@gigerIT

@gigerIT gigerIT commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #284.

ModalRoot registers its request interceptor during setup and removes it in onUnmounted, which never runs during server rendering. Every SSR render therefore left a handler, and the page props it closes over, on the shared http client.

This skips the registration when window is undefined. It stays in setup rather than moving to onMounted, because the interceptor has to be in place before Inertia 3 loads deferred props.

The new tests/ModalRoot.ssr.test.js renders ModalRoot with renderToString in a Node environment; it fails without the change.

🤖 Generated with Claude Code

onUnmounted never runs during server rendering, so each render left a
handler (and its page props) on the shared http client. Fixes inertiaui#284.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModalRoot leaks a request interceptor per SSR render

1 participant