kit
kit copied to clipboard
SetInterval does not clear on HMR reload / code change
Describe the bug
this i use to observe changed value $: { filterSearchResults(searchTerm); console.log(selections); } ------ but this goes out of control and keeps printing forever setInterval(() => { console.log(selections); }, 1000);
Reproduction
this i use to observe changed value $: { filterSearchResults(searchTerm); console.log(selections); } ------ but this goes out of control and keeps printing forever setInterval(() => { console.log(selections); }, 1000);
Logs
No response
System Info
System:
OS: Windows 10 10.0.19045
CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Memory: 7.16 GB / 15.94 GB
Binaries:
Node: 20.6.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.7.6 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Chromium (120.0.2210.91)
npmPackages:
@sveltejs/adapter-auto: ^3.0.1 => 3.0.1
@sveltejs/adapter-node: ^2.0.1 => 2.0.1
@sveltejs/kit: ^2.0.4 => 2.0.4
@sveltejs/vite-plugin-svelte: ^3.0.0 => 3.0.1
svelte: ^4.2.8 => 4.2.8
vite: ^5.0.10 => 5.0.10
Severity
serious, but I can work around it