-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
Describe the bug
Prerendered functions don't work with SSR in Cloudflare Workers. When I disable ssr with export const ssr = false, the issue no longer persists.
Reproduction
Repository: https://github.com/alecbakholdin/minimal-cloudflare-remote-fn-test (build files included)
Bug in the wild: https://minimal-cloudflare-remote-fn-test.alecbakholdin.workers.dev
- Create a remote function (
const testFn = export const testFn = prerender(() => { return "testing"; });) - Call remote function in
src/routes/+page.sveltewith{await testFn()} npm run build && npx wrangler deploy- Go to the site and see 500. Logs below
Logs
This is the only relevant log I can find
�[1;31m[500] GET /�[0m
Error: Prerendered response not found
at _worker.js:3303:25
at async _worker.js:3312:42
at async _worker.js:3297:18System Info
System:
OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700K
Memory: 11.74 GB / 15.47 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.19.0 - /home/abakholdin/.nvm/versions/node/v20.19.0/bin/node
npm: 11.6.2 - /home/abakholdin/.nvm/versions/node/v20.19.0/bin/npm
pnpm: 10.18.2 - /home/abakholdin/.nvm/versions/node/v20.19.0/bin/pnpm
Deno: 2.5.6 - /home/abakholdin/.local/share/nvim/mason/bin/deno
npmPackages:
@sveltejs/adapter-auto: ^7.0.0 => 7.0.0
@sveltejs/adapter-cloudflare: ^7.2.4 => 7.2.4
@sveltejs/kit: ^2.48.5 => 2.49.1
@sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1
svelte: ^5.43.8 => 5.45.6
vite: ^7.2.2 => 7.2.6Severity
serious, but I can work around it
Additional Information
I can't reproduce this minimally, but on the project where I discovered this bug, sometimes this would work on first page load but not on reloads or afterwards on client-side navigation.
Metadata
Metadata
Assignees
Labels
No labels