svelte: Svelte 5: Doesn't work on iOS 15.0

Describe the bug

I tried to render a simple “Hello” world with Svelte 5 using SvelteKit on iOS 15.0 and page is blank and get a hydration error:

Screenshot 2024-02-08 at 4 22 46 PM

I also tried using Astro to not just blame SvelteKit and still get the error:

Screenshot 2024-02-08 at 4 38 22 PM

Reproduction

Open Svelte 5 app (develop & preview) on an iPhone 6s on iOS 15 Simulator and open page

Logs

No response

System Info

iPhone 6s on iOS 15 Simulator

Severity

blocking an upgrade

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Support is only good as of very recently so I would be in favor of avoiding this method in the runtime (or apply a polyfill ourselves). I’m wondering how we can avoid these kinds of accidental breakages in general. In the meantime, you can polyfill it something like this.

Yeah, as mentioned, we think it does make sense for the Svelte runtime to avoid using Array.prototype.at. The polyfill on your end should only need to be temporary.

I wonder if there is a simple tool to scan a build and just tell you support, though full e2e tests is safer.

I think in eslint you can specify an EcmaScript version so it will flag any use of newer browser APIs for you

I’m saying that transpilation (like that you can configure via Vite) won’t help with API things like Array.prototype.at. If you need your app to work on browsers without that method today, a polyfill for it is probably your best best. But I’m also saying that it does probably seem reasonable for Svelte’s internal API to avoid using this, so that polyfilling it wouldn’t be necessary.