-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partytown breaks VT fallback #8862
Comments
Help wanted! Obviously the minimal example does not work for @florian-lefebvre, but I was not able to reproduce the error with Firefox. Who can help to identify the source of this behavior? |
I can reproduce the issue. I could take a closer look later this week. video.mp4 |
Affects firefox only, not Safari. https://bugzilla.mozilla.org/buglist.cgi?quicksearch=NS_ERROR_NOT_INITIALIZED |
I also got the same issue, firefox + partytown + VT |
partytown + firefox + view transitions is broken: withastro/astro#8862 besides, it seems like my scripts cant be used with partytown This reverts commit 8494403.
This one might be hard to debug. The Firefox-specific error does not provide a stacktrace. I'm pretty sure it has to do with Partytown's usage of low-level APIs (Atomics, SharedArrayBuffer) that exposes a memory-management bug in Firefox, but there is no straightforward way to confirm. |
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import partytown from "@astrojs/partytown";
// https://astro.build/config
export default defineConfig({
site: 'https://example.com',
integrations: [mdx(), sitemap(), partytown()],
+ vite: {
+ build: {
+ minify: false
+ }
+ }
}); |
Do you think it's worth opening an issue usptream or is it really caused by Astro? |
I deployed a vercel preview with your suggested workaround because it didn't work locally, and it didn't work either. You can check it out at https://legismusicastro-lfkizaw6x-legis-music.vercel.app |
I'm not sure yet. Since, view transitions are necessary for it to break on Firefox, there might be a fix possible on Astro's side. Just as long as it's not too drastic. |
Using a build of partytown with minification turned off pointed me to a single line. Partytown patches the History API, and its code runs whenever the History API is used. It seems like an issue for Firefox to fix, although Partytown may be able to remove this hacky code. Astro's usage of history API is necessary and proper. |
Reducing priority only because it is a signal astro maintainers use to pick up issues. This is not something for them to fix. |
I created the bug here, maybe this can help: |
|
Might be able to prevent it by stopping Partytown from highjacking pushState, going to give that a try. |
Looks like that will work. |
@matthewp can you post a code snippet? |
@emish89 I can create a preview release for you to try. You might lose events, I'm not sure. Hopefully not. |
@emish89 could you try out |
ok tomorrow I'm going to try. |
@emish89 have you confirmed that removing the setTimeout does fix it? |
It was not sufficient to prevent the failure when I tried it. It has been a while though, it's possible I missed something. |
in my local worked, but for sure I'm not an expert of the package. If they put it, is because there was some reason... @lilnasy do you remember what can I test to be sure if is working or not? |
If firefox does not error anymore then disregard what I said. The only tests to worry about would be the ones in partytown repo. |
@emish89 did you get a chance to try out |
I would say that is working, for sure is not breaking, but I'm not 100% sure if is sending data to GA. |
Ok, I'm going to suggest that we go with this then. The most important thing is that page navigation is not broken. If Partytown is causing it to be so, then the priority should be for us to avoid that. |
totally understandable and I agree. I confirm that in my case is now not breaking with this version. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When creating a partytown script and navigating to a new page in an unsupported browser (like firefox), VT breaks: url is not updated, event listeners are not triggered etc but page swaps. See video.
Astro.Blog.Firefox.Developer.Edition.2023-10-18.15-48-05.mp4
What's the expected result?
Shouldn't break
Link to Minimal Reproducible Example
https://github.com/florian-lefebvre/astro-vt-fallback-bug
Participation
The text was updated successfully, but these errors were encountered: