crystal-lang / crystal-website

crystal-lang.org website
61 stars 77 forks source link

New site doesn't load on Mobile Safari #758

Open jwoertink opened 7 months ago

jwoertink commented 7 months ago

Love the new design :raised_hands: but I'm having trouble getting it to load on mobile. I'm using iOS 17.4.1 on iPhone 13.

This is after clearing cache, and I've also tried opening up in private browsing.

IMG_2582

After a few attempts, I was able to get the logo to load as well, but still nothing else.

straight-shoota commented 7 months ago

That's odd. We had a test with iOS 17.3.1 where everything was fine. 🤔

jwoertink commented 7 months ago

I tried connecting to the safari debugger to see if I could get anymore info, but the network panel looked fine, and there weren't any issues in the console... Though, I'm not sure I trust the debugger since updating my mac :confused: I have issues with it on my own site. I'll see if I can get any other info on this.

straight-shoota commented 7 months ago

I did another test with iPad Pro 12.9", 2nd Generation iPadOS 17.2 (21C62) and everything looks fine there.

jwoertink commented 7 months ago

Yeah, it's still doing it for me. One weird thing I noticed is the site actually loads and I see all of the elements for a split second, then they all go away except for 1 or 2 parts. Then if I try to reload the page, it just never loads. No plugins or extensions, and it happens using Wifi and 5G networks. I can do a screen recording and send it if you want. Not sure if github will let me submit a video in a comment. If you'd like, let me know where I can send a screen recording.

jwoertink commented 7 months ago

Just to make sure it's not just me, it looks like @russ gets the issue too

image

However, the other people on my team seem to load the site fine. Clearing cache on the entire browser and private browse tab still doesn't fix it.

russ commented 7 months ago

Just to note, the site does load on mobile, but just content above the fold. Scrolling down you see everything just blank after Johannes Müller. iPhone 11, iOS 17.3.1

straight-shoota commented 7 months ago

We received another report here: https://fosstodon.org/@fnordfish@ruby.social/112205967637696757

fnordfish commented 7 months ago

iPhone 11 Pro, iOS 17.4.1

https://ruby.social/@fnordfish/112205967220293581

The most confusing part is, that reload seems to be blocked.

jwoertink commented 7 months ago

reload seems to be blocked.

Ok, so it's not just me... That's made it very difficult to try and debug because when I open the safari dev inspector, then refresh, it never loads :joy:

crysbot commented 7 months ago

This issue has been mentioned on Crystal Forum. There might be relevant details there:

https://forum.crystal-lang.org/t/website-relaunch/6719/17

beta-ziliani commented 7 months ago

As a workaround, given that the issue doesn't show up in iOS Simulator, I suggest to detect the user agent and replace the page with a banner stating that it doesn't work on that browser 🤷 Apple, I hate you.

jwoertink commented 7 months ago

If anyone wants to do some live debugging, maybe on a discord video chat or whatever, let me know. I can hit the site while y'all watch the logs or something.

straight-shoota commented 7 months ago

Let's try to figure out the specific cause for this mishap. We can disable parts of the website and see what makes it render correctly.

A binary search through _sass/main.css and js/bundle.js with removing parts of those files could be a good pointer.

@jwoertink If you're willing to help, would you try running the website locally (instructions are in the README) while making some modifications? I could also prepare a couple of preview branches to test, but that's going to slow down iterating.

jwoertink commented 6 months ago

Cloned the site and pulled it up locally on my phone with ngrok. Good news is I'm able to recreate the issue :tada:

Removing this section seems to fix it

https://github.com/crystal-lang/crystal-website/blob/e72f1e1aa51fc9566587016aa7367e146c13c652/_sass/pages/_home.scss#L37-L53

or I guess more accurately, removing these two lines

background-size: clamp(30vw, max(80rem, 50vw), 250vw) auto;
background-position: clamp(-15vw, -40rem + 50vw, 0px) top;
straight-shoota commented 6 months ago

Thanks for digging into this, Jeremey! ❤️

This is quite interesting. Maybe Safari has an issue with rendering this big background image with lots of thin lines and transparency... It causes issues as soon as the SVG is loaded.

beta-ziliani commented 6 months ago

780 still doesn't fix it on iPhone 11 Pro Max with iOS 17.4.1

jwoertink commented 6 months ago

Oh weird... Yeah... assuming that PR was deployed, it seems to still be doing it :thinking: Could it be cache just holding on to the old version?

straight-shoota commented 6 months ago

Hm, I think it's unlikely. But could you try the master branch locally again? If the fix works there, we know we need to look at caches or any other issue related to loading from the internet.

jwoertink commented 6 months ago

Ok, so I pulled down master, booted it locally, threw it up on ngrok, and got the same deal... However, after removing that entire &::before section and a couple of refreshes, I get this

IMG_2732

This is what happened last time too though. After I updated the sass, I did have to refresh like 5 times before it worked. I assumed it was cache, but maybe it's actually some race condition with the sass?

Also a side note, but I had to disable livereload. The site wouldn't come up for me at all through ngrok with it enabled. I'm sure that's unrelated, but still wanted to note.

straight-shoota commented 6 months ago

Hm, that's too bad 😢

I guess we'll have to remove the entire pattern background then. Or figure out how to fix this for real 🤷

I assumed it was cache, but maybe it's actually some race condition with the sass?

If it is a race condition, it must be in Safari.