Blog

SvelteKit load functions: server-side fetch without CORS, hooks, and browser-only API calls after navigation

Data loaded in `+page.server.ts` runs on the server—client navigations that refetch need CORS on the API.

1 min read
sveltekitcorsssr

Adapters

Node versus edge adapters may see different outbound IPs—some APIs whitelist origins per IP.

Streaming responses from load functions should still set cache headers compatible with CDN CORS.

Service workers

SvelteKit service worker precaching does not replace CORS for runtime API calls.

Workbox strategies should forward `mode: 'cors'` explicitly for opaque response pitfalls.

Back to blog