Index of every page on this site: llms.txt
All skills
spences10 avatar

/svelte-deployment

@5fe4989
Run it yourself

Svelte deployment guidance. Use for adapters, Vite config, pnpm setup, library authoring, PWA, or production builds.

Use this Skill: https://skilld.dev/gh/spences10/svelte-skills-kit/svelte-deployment

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescloudflare-gotchas.md

≈402 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Cloudflare Gotchas

Streaming Broken

Problem: Cloudflare may remove Transfer-Encoding: chunked header, breaking HTML streaming in SvelteKit.

Symptoms:

  • Page loads as one chunk instead of streaming
  • await blocks don't show progressive loading
  • Longer initial page load times

Workarounds:

  1. Disable compression in Cloudflare dashboard (temporary)
  2. Use page rules to bypass caching for dynamic routes
  3. Switch to Cloudflare Workers adapter for more control
// svelte.config.js
import adapter from '@sveltejs/adapter-cloudflare';

export default {
	kit: {
		adapter: adapter({
			routes: {
				include: ['/*'],
				exclude: ['<all>'],
			},
		}),
	},
};

View Transitions Bug

Problem: Same-page view transitions may not work correctly.

Fix: Update BOTH SvelteKit AND Svelte to latest versions:

pnpm add @sveltejs/kit@latest svelte@latest

Both packages had related bugs that needed fixing together.

Environment Variables

Cloudflare uses different env variable handling:

// +page.server.ts
export const load = async ({ platform }) => {
	// Access via platform.env, not process.env
	const apiKey = platform?.env?.API_KEY;

	return { data };
};

WebSocket Issues with Bun

Problem: Bun's WebSocket module incomplete for Cloudflare Workers.

Workaround: Use Node.js or tsx runner instead of Bun for WebSocket-heavy apps.

DNS Proxy Settings

If using Cloudflare for DNS only (gray cloud), streaming works normally. Issues occur when traffic is proxied through Cloudflare (orange cloud).

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning25d4 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides legitimate deployment guidance for SvelteKit projects, including configuration for various adapters (Cloudflare, Node, Static), PWA setup, and library authoring. It uses official Svelte ecosystem packages and follows standard practices for environment variable access and project configuration.

  • Socket25d

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    4/4 files flagged

Signed by skilld at 5fe4989. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago

README badge

README badge for spences10/svelte-skills-kit/svelte-deployment