0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Fix-component-undefined-svelte-v5 (#12102) (#12129)

* - fix: 'component is not defined' error when unmount svelte 5 component

* added changeset

* Moving unmount listener to where the component is defined.

* Update .changeset/eighty-ligers-punch.md



---------

Co-authored-by: Hermit <70563349+hermit99@users.noreply.github.com>
This commit is contained in:
Martin Trapp 2024-10-05 13:16:14 +02:00 committed by GitHub
parent 6e1dfeb76b
commit 5bc6223b12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/svelte': patch
---
Fixes an Reference Error that occurred during client transitions

View file

@ -39,8 +39,7 @@ export default (element) => {
},
});
existingApplications.set(element, component);
}
element.addEventListener('astro:unmount', () => unmount(component), { once: true });
}
};
};