-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
SvelteKit apps do not work in the Steam in-game overlay browser #10069
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
Comments
I have also tested an Astro app with svelte components and am experiencing similar issues. |
"Create a new svelte-4 demo application" what exactly do you mean by that? Which template / scaffolding CLI are you using for this? |
Sorry, I meant using the |
After some testing, the error appeared for Chrome 91 and earlier. The issue is resolved as of Chrome 92 and onward. I can't do further testing since the service I was using provided only a minute. Can anyone comment on the likelihood that this issue will be fixed? I'm happy to do more testing to find a way forward if there is one. |
From what I can tell, the error is arising from the use of https://caniuse.com/mdn-javascript_builtins_array_at in the Sverdle portion of the demo app. I confirmed this by running the demo site in BrowserStack, and according to caniuse this would also align with your observation that it is broken in 91 and works in 92. As far as adjusting the demo app to not use this syntax goes, I'm not sure that's worthwhile. I do think there's an argument for not using it in SvelteKit's browser runtime code, but as far as I can tell, it's already not being used there. (See also #6082.) What's causing your particular app to break may or may not be |
Awesome, thanks for taking a look. I might have to pony up for some more time on browserstack to actually debug. I'll check out my code and see if I'm using any unavailable browser features, but I know for sure I haven't used It's unlikely that SvelteKit's runtime is the perpetrator as some sites seem to work totally fine. |
Appears to be related to: sveltejs/kit#3247 |
After further testing and Googling, I'm finding that there doesn't appear to be a way to polyfill sveltekit as I'm really, really hoping there is some sort of fix floating around for this that I don't know about. Or that I'm mistaken about this situation, but it appears that I simply cannot use Svelte for my project. |
|
I haven't tried converting my entire app to svelte 4 yet. As per @Conduitry, svelte-4 sverdle has the same error with |
Without a polyfill is there any way I can move forward with my project? |
Probably not, but creating a polyfill for |
Would I need to make a vite plugin for that? I know how to write a polyfill but I'm not fluent in build tools. |
If it's just a polyfill you think you need rather than transpilation, you could just stick the code somewhere it's going to get run early - for example in another |
Something like this in your <script>
Array.prototype.at = function (index) {
return index < 0 ? this[this.length + index] : this[index];
};
</script> You could even check if |
In a world full of frameworks, sometimes I forget that I can just write code.
And it seems to be working at a basic level now. I'll have to go through and edit my code to make it work with Chrome 85, so it's still unfortunate that the base vite polyfill plugin isn't compatible with SvelteKit, but at least it works. Probably can't use some CSS features, etc. If anyone runs into a similar-ish issue, note that on Chrome 84 and below the |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Various parts of svelte applications do not work in the Steam in-game overlay browser.
Several apps I've tested fail to hydrate correctly with and without kit.
The svelte-4 demo app navigation does not work. I have tested on both Windows and Mac.
It's inconsistent, as the sveltekit docs seem to work fine. It's extremely difficult to debug as the browser provides no developer tools, and there are many possible user agents.
I am building something that needs to work in the overlay browser, so this is fully blocking.
Reproduction
npm create svelte@latest
and selecting the "demo app" optionLogs
No response
System Info
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: