Sveltekit streaming?

Streaming, snapshots, and other new features since SvelteKit 1.0
Exciting improvements in the latest version of SvelteKit
16 Replies
Vero
Vero16mo ago
Hi, I’m passing this internally to see if Pages support it Yes, @rviteri , Pages support streaming😄
Ricardo Viteri
Ricardo Viteri16mo ago
Hi @veerooo are there any specifics I should take into account? On the Svelte Discord another user said they've had issues with Cloudflare. I am currently on the free plan. Hi, I just wanted to report that I tested this and it works fine on nodejs when in dev but does not work after the build is deployed to Pages (I am using the cloudflare sveltekit adapter)
Wayne
Wayne16mo ago
I had issues with streaming, but resolved it by specifying node version 16.19.
Ricardo Viteri
Ricardo Viteri16mo ago
@waynemorgan did you set the NODE_VERSION environment variable to 16.19?
Wayne
Wayne16mo ago
yes
Ricardo Viteri
Ricardo Viteri16mo ago
I have mine as 16 I am not sure if adding the specific version would make a difference
Wayne
Wayne16mo ago
it has to be greater than 16.14
Ricardo Viteri
Ricardo Viteri16mo ago
okay let me try it and I'll report back
Wayne
Wayne16mo ago
I had this message on a fresh install
Your Node version is incompatible with "/@sveltejs/kit/1.13.0_svelte@3.57.0+vite@4.2.1".

Expected version: ^16.14 || >=18
Your Node version is incompatible with "/@sveltejs/kit/1.13.0_svelte@3.57.0+vite@4.2.1".

Expected version: ^16.14 || >=18
Ricardo Viteri
Ricardo Viteri16mo ago
It still doesn't work for me, there must be something else with my code that breaks using pages as it works fine with my dev environment
Wayne
Wayne16mo ago
what node version are you using in local dev if i use node 16.1.0 in local dev I get the following error :
failed to load config from C:\Github\SVELTE_TEST\vite.config.js
error when starting dev server:
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:stream/web
failed to load config from C:\Github\SVELTE_TEST\vite.config.js
error when starting dev server:
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:stream/web
did you redeploy after changing node version?
Vero
Vero16mo ago
if you need Node 18+ you can register for the beta that supports that in #Build Image Beta Testing @waynemorgan @rviteri
Ricardo Viteri
Ricardo Viteri16mo ago
Yes, I did @veerooo is there a way to view pages logs? I've always wondered how to do this. I know that workers has a debug option to see the incoming requests live but I can't find the same for Pages.
Vero
Vero16mo ago
Yesss, wrangler pages deployments tail <deployment id> Or in the dashboard, you can click on the specific deployment from your project, and go to the Functions tab
Ricardo Viteri
Ricardo Viteri16mo ago
Great! I just found it! Error: To use the new ReadableStream() constructor, enable the streams_enable_constructors feature that seems to be the error "Error: To use the new ReadableStream() constructor, enable the streams_enable_constructors feature flag.\n at render_response (bundledWorker-0.3160733881048463.mjs:37792:5)\n at async render_page (bundledWorker-0.3160733881048463.mjs:38337:12)\n at async resolve2 (bundledWorker-0.3160733881048463.mjs:38885:22)\n at async respond (bundledWorker-0.3160733881048463.mjs:38781:22)\n at async Object.fetch (bundledWorker-0.3160733881048463.mjs:39190:13)"
Wayne
Wayne16mo ago
I found that cloning an app and building/deploying to a new page resolved an issue I had with streaming. I am not sure if its a cache problem when redeploying