document is not defined in HMR
I have some logic that is running in onMount and onCleanup that adds/removes a data-attribute from an element. It works. However when I make a change somewhere in my project, I get
document is not defined
error from HMR. It seems to be triggered by cleanNode
so I am pretty sure it's from the onCleanup
.
The code itself looks like this shouldn't happen though because I use optional chaining. Any ideas?
Thank you 🙂2 Replies