Open martinhjartmyr opened 1 month ago
I'm trying to enable streaming support for SvelteKit.
const app = new sst.aws.SvelteKit('App', { transform: { server: { streaming: true, timeout: '60 seconds', }, } })
Streaming works out of the box when running sst dev vite dev.
sst dev vite dev
However, when deployed to AWS, the lambda returns JSON instead of the rendered HTML (content-type: text/html):
{"statusCode":200,"headers":{"content-type":"text/html"},"body":"<!doctype html>\n<html lang=\"en\">\n\t<head>...
+page.server.ts
export const load: PageServerLoad = async () => { return { _test: new Promise((resolve) => { setTimeout(() => { resolve('Hello from the server!') }, 3000) }), } }
+page.svelte
<script lang="ts"> import type { PageData } from './$types' export let data: PageData </script> {#await data._test} Loading ... {:then test} {test} {/await}
Am I missing something, or is this not yet implemented?
it's not yet implemented - i'll look into this
I'm trying to enable streaming support for SvelteKit.
Streaming works out of the box when running
sst dev vite dev
.However, when deployed to AWS, the lambda returns JSON instead of the rendered HTML (content-type: text/html):
{"statusCode":200,"headers":{"content-type":"text/html"},"body":"<!doctype html>\n<html lang=\"en\">\n\t<head>...
Example
+page.server.ts
+page.svelte
Am I missing something, or is this not yet implemented?