Replies: 7 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Ha! I found the root cause!! If I disable the gurubase widget and Google tag manager, I won't see the detached elements any more. So I think the memory leak is coming from gurubase widget and Google tag manager. I think these 3rd party scripts might have objects the hold references to DOM elements that are used to be part of DOM. 👎 to these 3rd party components that handle GC carelessly. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
that being said, with a clean project + the todo app, there are no detached elements. I will keep digging to try to figure out what is holding on to these.. |
Beta Was this translation helpful? Give feedback.
-
created a simpler version of my project without UI but including todo app: |
Beta Was this translation helpful? Give feedback.
-
Could a
const alerter = vanX.reactive({ |
Beta Was this translation helpful? Give feedback.
-
After much digging, I've found the code that was causing most of the detached nodes const stateFields = vanX.stateFields(PR)
const skipFields = ['strokeSeed']
Object.keys(stateFields).forEach(key => {
if (skipFields.includes(key)) return
van.derive(() => {
// prnt(`${key} -> ${stateFields[key].val}`)
const fake = stateFields[key].val
PR.saveAppState()
})
}) I was trying to save this reactive object whenever any prop changed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to create an image gallery using vanX.list and running into an issue where dom elements are becoming detached and not garbage collected when removed from the reactive array, creating a memory leak.
Digging into this, I found that vanX.list seems to produce this effect even on vanX docs:

Even after clicking the chome garbage collect button, these detached nodes persist. Is there a way to get rid of these detached nodes?
Beta Was this translation helpful? Give feedback.
All reactions