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
We started experiencing memory leaks after rendering forms on the server (we previously had wrapped them in ClientOnly).
What we are seeing in local production builds with Node debugging in Chrome Devtools is that the DEVTOOLS_FORMS object keeps expanding with a reference to refreshInspector function when scouring through the heatmap. Since objects in the DEVTOOLS_FORMS object contains references to Vue component instances, it grows quite significantly.
Our investigations lead to the conclusion, that if we manually set NODE_ENV to production the memory leaks disappears.
I am not quite sure how it happens, but it seems like the value of process.env.NODE_ENV in vee-validates code is read before it is set to production in vite/nuxt resulting in devtools being registered on the server - even in production builds. However, I am not sure devtools should ever be registered on the server?
Reproduction steps
Setup custom Form component with useForm in a Nuxt project, build it and launch it in production mode with node .output/server/index.mjs
Server render the Form while having Node debugging enabled
Record heatmap, reload x times, record heatmap and watch allocation of form contexts grow - maintained in the DEVTOOLS_FORMS object
...
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Firefox
Chrome
Safari
Microsoft Edge
Relevant log output
No response
Demo link
No demo link available. A reproduction can be created if required.
What happened?
We started experiencing memory leaks after rendering forms on the server (we previously had wrapped them in ClientOnly).
What we are seeing in local production builds with Node debugging in Chrome Devtools is that the
DEVTOOLS_FORMS
object keeps expanding with a reference torefreshInspector
function when scouring through the heatmap. Since objects in theDEVTOOLS_FORMS
object contains references to Vue component instances, it grows quite significantly.Our investigations lead to the conclusion, that if we manually set
NODE_ENV
toproduction
the memory leaks disappears.I am not quite sure how it happens, but it seems like the value of
process.env.NODE_ENV
in vee-validates code is read before it is set toproduction
in vite/nuxt resulting in devtools being registered on the server - even in production builds. However, I am not sure devtools should ever be registered on the server?Reproduction steps
node .output/server/index.mjs
...
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
No demo link available. A reproduction can be created if required.
Code of Conduct
The text was updated successfully, but these errors were encountered: