vercel-labs / vercel-labs/native

Svelte example doesn't work

Open
#48 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Zig
Stars
7.7k
Forks
314
Avg merge
5h
Merged PRs (30d)
13

Description

When running either the svelte example from the cloned examples/ directory, or after generating a fresh svelte project, I am getting this error:

Uncaught Svelte error: component_api_invalid_new
Attempted to instantiate src/App.svelte with `new App`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.
https://svelte.dev/e/component_api_invalid_new

	in <unknown>
    component_api_invalid_new errors.js:103
    check_target legacy.js:8
    App App.svelte:17
    effect hmr.js:51
    update_reaction runtime.js:259
    update_effect runtime.js:468
    create_effect effects.js:138
    branch effects.js:432
    wrapper hmr.js:42
    update_reaction runtime.js:259
    update_effect runtime.js:468
    create_effect effects.js:138
    block effects.js:409
    wrapper hmr.js:31
    <anonymous> main.js:4
errors.js:103:17
    component_api_invalid_new errors.js:103
    check_target legacy.js:8
    App App.svelte:17
    effect hmr.js:51
    update_reaction runtime.js:259
    update_effect runtime.js:468
    create_effect effects.js:138
    branch effects.js:432
    wrapper hmr.js:42
    update_reaction runtime.js:259
    update_effect runtime.js:468
    create_effect effects.js:138
    block effects.js:409
    wrapper hmr.js:31
    <anonymous> main.js:4

(The screen is just white, and to get this error, I just opened the page in firefox)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the Svelte example from the examples/ directory and inspect the stack-trace locations in src/App.svelte and main.js. Compare the generated project with the example and verify that opening the page no longer produces component_api_invalid_new or a white screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.