gornostay25 / svelte-adapter-bun

A SvelteKit adapter for Bun
MIT License
534 stars 33 forks source link

[Bug] Await not working during SSR #45

Closed KaKi87 closed 6 months ago

KaKi87 commented 9 months ago

Hi,

When using {#await data.foo} in template, the content between before {:then foo} is displayed before SSR, instead of the content after it.

Thanks

KyleFontenot commented 8 months ago

? That's how it's meant to be used, unless you wrote a typo somewhere. The content before {:then foo} shows until data.foo is resolved. Then {:then foo} shows.

KaKi87 commented 8 months ago

During CSR yes, but during SSR, the server is supposed to wait for the Promise before rendering.

KyleFontenot commented 8 months ago

What version of Kit are you on? I'd think you'd be awaiting the promise server-side then. Are you going along the lines of this?: https://kit.svelte.dev/docs/load#streaming-with-promises

They changed the default behavior of this in newer version. so I'm thinking you may be on the newer version that does not await the first returned value in page load.?

KaKi87 commented 8 months ago

Indeed I am. So you're not going to follow this change ?

KyleFontenot commented 8 months ago

Indeed I am. So you're not going to follow this change ?

I'm not a maintainer, I'm just trying to help. 👍 I wouldn't think that it is the adapter that'd be ignoring an implicit await, but I don't know the guts enough. Best of luck

KaKi87 commented 8 months ago

Sorry for the confusion :sweat_smile: And thanks for trying :pray: