One way to fix it would be to use the onDestroy
:
<script>
import { count } from './stores.js';
import Decrementer from './Decrementer.svelte';
import Resetter from './Resetter.svelte';
Any name beginning with
$
is assumed to refer to a store value. It’s effectively a reserved character — Svelte will prevent you from declaring your own variables with a$
prefix.