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

Fixed an "Uncaught ReferenceError" inside of the @astrojs/vue package (#12116)

* fix(vue): initialized the 'app' variable earlier in the client.js script by assigning the 'appInstance' reference to it so that it is available for the later established 'astro:unmount' event listener

* Add changeset

* fix(vue): reverted the last change and instead moved the 'astro:unmount' event listener to inside of the 'if' statement where the 'app' variable is initialized

---------

Co-authored-by: Matt Kane <m@mk.gg>
This commit is contained in:
sammibajrami 2024-10-05 13:48:30 +02:00 committed by GitHub
parent 5bc6223b12
commit af8401ebf9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

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

View file

@ -44,12 +44,12 @@ export default (element) =>
await setup(app);
app.mount(element, isHydrate);
appMap.set(element, appInstance);
element.addEventListener('astro:unmount', () => app.unmount(), { once: true });
} else {
appInstance.props = props;
appInstance.slots = slots;
appInstance.component.$forceUpdate();
}
element.addEventListener('astro:unmount', () => app.unmount(), { once: true });
};
function isAsync(fn) {