-
-
Couldn't load subscription status.
- Fork 4.7k
Description
Describe the bug
When awaiting render() when compilerOptions.experimental.async isn't enabled, the experimental_async_ssr warning is shown. Problem is, there's no way to know if the result is awaitable from its shape because then is always present: https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/internal/server/renderer.js#L352-L384. That's an issue for us in Astro.
My recommendation would be to only set the then property if async_mode_flag is true so we can do checks like 'then' in result:
let result = render(...)
if (isPromise(result)) {
result = await result
}That currently forces us to make a pretty big workaround, see withastro/astro#14526.
I'd be happy to open a PR
Reproduction
See withastro/astro#14508 and https://stackblitz.com/edit/github-tpnsqnas?file=src%2Fpages%2Findex.astro
Logs
System Info
N/ASeverity
annoyance