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:
I also tried using Astro to not just blame SvelteKit and still get the error:
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
- chore: runtime linting - check that the runtime doesn't use methods that are too new - add linting rule to prevent references to the compiler in the runtime (this is important for the first check, el... — committed to sveltejs/svelte by dummdidumm 2 years ago
- chore: runtime linting - check that the runtime doesn't use methods that are too new - add linting rule to prevent references to the compiler in the runtime (this is important for the first check, el... — committed to sveltejs/svelte by dummdidumm 2 years ago
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 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.