Closed lanfeust21 closed 6 months ago
Components are no longer classes.
+ import { createRoot } from 'svelte';
import App from './App.svelte'
- const app = new App({ target: document.getElementById("app") });
+ const app = createRoot(App, { target: document.getElementById("app") });
export default app;
Describe the bug
The application does not start in the browser app.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'call')
Reproduction
i join 2 simple projects one in svelte4 and the equivalent in svelte 5 -- App.svelte --
Work ID: {workId}
---app.js---- import App from "./App.svelte";
let div = document.createElement("div"); div.id = "app"; document.body.appendChild(div);
const app = new App({ target: document.getElementById('app'), props: { userId: 1 } }); export default app;
cp src/index.html build/. start a local web server, and you will see that in svelte 4 the App is running, not in svelte5.
svelte5_iife.zip svelte4_iife.zip
Logs
System Info
Severity
blocking all usage of svelte