Skip to content

fix: mount Svelte example and CLI template with Svelte 5 API#99

Open
mliem2k wants to merge 1 commit into
vercel-labs:mainfrom
mliem2k:fix/svelte-5-mount-api
Open

fix: mount Svelte example and CLI template with Svelte 5 API#99
mliem2k wants to merge 1 commit into
vercel-labs:mainfrom
mliem2k:fix/svelte-5-mount-api

Conversation

@mliem2k

@mliem2k mliem2k commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • examples/svelte/frontend/src/main.js and the native init Svelte scaffold (svelteMainJs() in src/tooling/templates.zig) both called new App({ target }), the Svelte 4 component constructor.
  • Svelte 5 (this repo depends on ^5.55.5) removed that constructor, so both the checked-out example and every freshly generated Svelte project throw component_api_invalid_new on load, as reported in Svelte example doesn't work #48.
  • Switched both to Svelte 5's mount(App, { target }) from the svelte package. Added a changelog fragment per CONTRIBUTING.md.

Fixes #48

Test plan

  • bun install && bun run build in examples/svelte/frontend builds cleanly
  • Served the production build and loaded it in a browser: renders with zero console errors
  • zig build test passes (exit code 0)

The svelte example and the native init Svelte scaffold both called
new App({ target }), the Svelte 4 component constructor. Svelte 5
removed it, so every checkout of examples/svelte and every freshly
generated Svelte project throws component_api_invalid_new on load.

Switch both to mount(App, { target }) from the svelte package.

Fixes vercel-labs#48
Copilot AI review requested due to automatic review settings July 10, 2026 19:49
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@mliem2k is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Svelte example doesn't work

2 participants