swup / astro

Astro integration for swup 🚀
90 stars 2 forks source link

Version 1.3.1 not working (1.3.0 works) #19

Closed micvolo closed 1 year ago

micvolo commented 1 year ago

Hello! First of all thanks for this package. i was already using swup with astro for an year but this make everything cleaner and easy.

I just wanted to warn you that with the last version of yesterday (1.3.1) there is something broken with the SwupA11yPlugin (maybe some versions?).

I also tryed with a clean astro project and same error.

The error is: Uncaught (in promise) TypeError: Cannot create property 'announcements' on boolean 'true'.

Am i doing something wrong? Thanks!

daun commented 1 year ago

Can you share the specific setup in your astro.config.js?

friedemannsommer commented 1 year ago

Hi @daun, i've got the same issue when i pass true as option to accessibility.

swup({
    accessibility: true
})

This seems to happen because the SwupA11yPlugin now also receives options.

Before the dynamic import change: https://github.com/swup/astro/blob/601d6e32c04a2baf2415e4b610222f5dda2b8e58/src/script.ts#L106-L121

After: https://github.com/swup/astro/blob/ca123cf589ccca015a973527de63ebe7e9840471/src/script.ts#L121-L123

Note that SwupA11yPlugin was instantiated without arguments before.

daun commented 1 year ago

Thanks for the detailed write-up. Fix incoming 🪴

daun commented 1 year ago

This should be fixed in release 1.3.2 — let us know if it isn‘t on your end.