vuetify-nuxt-module
vuetify-nuxt-module copied to clipboard
VDialog - Memory Leak with SSR
Environment
- Node :
20.9.0
Packages
- nuxt:
3.13.2 - vue:
3.5.11 - vue-router:
4.4.5 - vuetify-nuxt-module:
0.18.3 - vuetify (as dependency of vuetify-nuxt-module):
3.7.2
Description
Using "v-dialog" component causes memory leaks with Nuxt SSR.
Reproduction case
- Create a new nuxt project:
yarn dlx nuxi@latest init test - Add vuetify-nuxt-module:
yarn nuxi@latest module add vuetify-nuxt-module - Edit app.vue content:
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtWelcome />
<v-dialog v-model="open">
Hello world!
</v-dialog>
</div>
</template>
<script setup lang="ts">
const open = ref(true);
</script>
- Build the application:
yarn build - Run with inspector:
node --expose-gc --inspect .output/server/index.mjs - Go to http://localhost:3000 with Google Chrome
- Open dev console (F12)
- Click on the node icon "Open dedicated DevTools for Node.js" on the top of the DevTools
- Take a snapshot
- Reload the page multiple times (10 times in my case) and wait a moment to let Nuxt clear memory
- Take a snapshot and compare with previous one
The property "Object" went from 4 846 852 bytes to 7 564 180 bytes and I can see there are a lot of new "v-dialog" objects which are not deleted. The more I wait, the more there are new "v-dialog" in memory (even without refreshing the page). After several minutes, it was more than 20 Mbytes.
Here is a screenshot of the snapshot.
I've created a new project to isolate the issue, but I encountered the same problem with a real app, and with other vuetify components.
Any idea ?