oakstudios / joinmastodon

The official Mastodon project homepage
https://joinmastodon.org
0 stars 0 forks source link

Navigation bug when visiting `/servers` #71

Closed mikabusante closed 2 years ago

mikabusante commented 2 years ago

for some reason, going back to the homepage after being on the servers page, updates the page address but not the actual page, it stays on servers Actually, I can't seem to be able to open any page after being on the servers page

danielgamage commented 2 years ago

can anyone else repro this?

mikabusante commented 2 years ago

I can repro after clicking the repo link:

  1. from the home page click "Code"
  2. hit the back button
  3. Now i'm stuck on the homepage, clicking other nav items updates the url but not the page :0
mikabusante commented 2 years ago

actually, just went back to this, and the above no longer repros the issue hmmmm

danielgamage commented 2 years ago

so i can still repro it, but only in firefox? (v103)

mikabusante commented 2 years ago

i'm also trying to repro in firefox v103, but no luck for me

danielgamage commented 2 years ago

fwiw it only happens when i:

  1. open a new tab
  2. go to staging (local is fine?)

then the steps you listed:

  1. from the home page click "Code"
  2. hit the back button
  3. Now i'm stuck on the homepage, clicking other nav items updates the url but not the page :0

but it seems like more JS is broken than just the router, eg the header BG won't update:

image
mikabusante commented 2 years ago

ty ty, i can repro with that. there are these errors in the console:

Screen Shot 2022-08-05 at 1 04 29 PM

are you seeing these too? maybe something with loading the locale data?? 🔍

danielgamage commented 2 years ago

lol i'm glad you found that bc mine has 0 errors! 😰

mikabusante commented 2 years ago

maybe related https://github.com/i18next/next-i18next/issues/988? also https://github.com/vercel/next.js/issues/27744!!!!

mikabusante commented 2 years ago

also, i can repro locally when running yarn build/yarn start, just making sure it wasn't a vercel related issue

mikabusante commented 2 years ago

ok -- I believe this is a nextjs issue, but I don't fully understand it. I'd guess that this function runs when returning from an external page.

not 100% sure if this is the cause but comparing this to issue #27744 i linked above, that second return statement (return e) is not getting tree-shaken out and that's causing issues?

Screen Shot 2022-08-05 at 1 46 35 PM

a fix we can do on our side is having external links open in a new tab?

edit: can look into this more on monday, but this could also be possibly caused by the internationalized routing getting messed up when using an external url in the <Link> component?

danielgamage commented 2 years ago

i was wondering about the link thing too. 1571742e66 (preview) didn't help, but maybe using plain a tags would work