vercel-labs / vercel-labs/native
Svelte example doesn't work
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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