Skip to content

fix(examples): migrate example apps to SvelteKit 3 - #23

Merged
ivanbarlog merged 1 commit into
mainfrom
fix/sveltekit-3-examples
Oct 1, 2026
Merged

ivanbarlog merged 1 commit into
mainfrom
fix/sveltekit-3-examples

Conversation

@ivanbarlog

Copy link
Copy Markdown
Contributor

Problem

After the SvelteKit 3 adapter migration merged (#20), the Integration Tests workflow failed on main (run 36772575685) in ~37s with:

CannotFindAsset: Cannot find asset at examples/basic/build-esb/server

Root cause: the adapter package moved to SvelteKit 3, but the example apps still pinned @sveltejs/kit@^2.60.1 — which predates 2.62, where configuring the adapter via the sveltekit() Vite plugin was added. Under 2.60.1 the sveltekit({ adapter }) option was silently ignored ("No adapter specified"), so vite build produced no adapter output and CDK had no server asset to deploy.

A second latent issue surfaced once the builds worked: examples/basic/src/routes/+error.svelte still imported the removed $app/stores, so the custom 404 page threw at render and returned 500.

Changes

  • Bump example dev deps to the SvelteKit 3 floor: @sveltejs/kit@3.0.0-next.31, @sveltejs/vite-plugin-svelte@^7.3.0, svelte@^5.57.1, vite@^8.0.12 (both basic and streaming).
  • Await the now-async sveltekit() plugin in the example vite.config.ts files.
  • Migrate examples/basic/+error.svelte from $app/stores ($page) to $app/state (page).

Verification

  • All three build variants emit server/ output: esb+node, bun+node (via bun --bun run build), and streaming.
  • bun run integ:local: 18 pass, 0 fail across esb/bun/HTTP-API configs (boots the built handlers locally, no AWS).
  • bun run check: 0 warnings, 0 errors. bun test: 0 fail.

The full AWS deploy/destroy suite (integ:deploy-test-destroy) still needs a run — apply the run-integ label or let the push-to-main trigger exercise it after merge.

The adapter migrated to SvelteKit 3, but the example apps still pinned
@sveltejs/kit ^2.60.1 (pre-2.62, before adapter-via-Vite-plugin support),
so the sveltekit({ adapter }) option was ignored and builds emitted no
server output — causing the integration workflow to fail with
CannotFindAsset on examples/basic/build-esb/server.

- Bump example @sveltejs/kit to 3.0.0-next.31, vite-plugin-svelte ^7.3.0,
  svelte ^5.57.1, vite ^8.0.12.
- Await the async sveltekit() plugin in the example vite.config.ts files.
- Migrate examples/basic +error.svelte from the removed $app/stores to
  $app/state (was rendering a 500 instead of the 404 error page).

Verified: all three build variants (esb+node, bun+node, streaming) emit
handler/stream output, and integ:local passes 18/18.
@ivanbarlog ivanbarlog added the run-integ Run the full AWS integration test suite on this PR label Sep 30, 2026
@ivanbarlog
ivanbarlog merged commit 44e7d50 into main Oct 1, 2026
7 checks passed
@ivanbarlog
ivanbarlog deleted the fix/sveltekit-3-examples branch October 1, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-integ Run the full AWS integration test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant