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
npm install
npm run build
npm run start
whiletrue;do curl -s localhost:3000 -o /dev/null;done
Perform a heap dump, for example in Chrome like this:
Open Chrome's dev tools
Click the NodeJS icon
Click the Memory tab
Click the trash icon to force garbage collection
Click "Take Snapshot"
In the heap dump, open the Summary, set the class filter to QueryClient, observe that there are hundreds/thousands of query clients.
Expected behavior
vue-query should use a different method to unmount during SSR or the SSR docs should explicitly state that you have to call queryClient.unmount() after a request
Describe the bug
In SSR, Vue will never do
app.unmount()
, so the query client never unmounts and cannot be garbage collectedYour minimal, reproducible example
https://github.com/schneefux/vue-query-memory-leak-reproduction
Steps to reproduce
Perform a heap dump, for example in Chrome like this:
In the heap dump, open the Summary, set the class filter to
QueryClient
, observe that there are hundreds/thousands of query clients.Expected behavior
vue-query should use a different method to unmount during SSR or the SSR docs should explicitly state that you have to call
queryClient.unmount()
after a requestPlatform
Reproduced on macOS and Linux with Nuxt and without a framework (as per https://vuejs.org/guide/scaling-up/ssr.html#rendering-an-app)
TanStack Query version
4.24.4
Additional Context
Related Vue discussions and issues:
The text was updated successfully, but these errors were encountered: