You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSR memory leak after a render error in a dynamic component #15070
download the reproduction from stackblitz (won't work there, needs to be run locally)
run pnpm i && pnpm leak
see the heap size & alive app instances grow with each request after the single failed render
The script renders 500 fresh SSR apps, which all get garbage-collected. Then renders one app whose slot content throws, then renders 500 more identical healthy apps, which will never be garbage collected afterwards.
A dynamic component <component :is> with a <slot /> is needed for this to reproduce.
I’m trying to understand the real-world expectation here.
The leak only starts after renderToString() has already failed with an unhandled render error. In that situation, wouldn’t the application need to fix or handle the render error—or restart the SSR worker—rather than continue serving from the same process? If the render error does not occur, there is no leak.
Do you have a production scenario where such render errors are expected and the same worker must continue serving requests afterward?
@edison1105 yes, I'm pretty sure this was the cause of a memory leak I had in one of my Nuxt apps in production
It's quite easy to do property access on null, but maybe not that common for it to be in a dynamic component's slot - otherwise this would be a much more common leak.
Activity
edison1105 commentedon Jul 12, 2026
I’m trying to understand the real-world expectation here.
The leak only starts after
renderToString()has already failed with an unhandled render error. In that situation, wouldn’t the application need to fix or handle the render error—or restart the SSR worker—rather than continue serving from the same process? If the render error does not occur, there is no leak.Do you have a production scenario where such render errors are expected and the same worker must continue serving requests afterward?
cernymatej commentedon Jul 12, 2026
@edison1105 yes, I'm pretty sure this was the cause of a memory leak I had in one of my Nuxt apps in production
It's quite easy to do property access on
null, but maybe not that common for it to be in a dynamic component's slot - otherwise this would be a much more common leak.Here is a Nuxt reproduction, if you want to check it out: https://stackblitz.com/edit/github-izbyovlx?file=app%2Fcomponents%2FCard.vue,app%2Fapp.vue
fix(runtime-core): unwind dangling blocks when slot content throws (#…