Wails version family
v2
Exact Wails version
v2.15.0
Operating System
macOS
Description
The svelte and svelte-ts v2 templates pin svelte: "^5.55.7", but their generated main.js/main.ts still bootstrap the app using the Svelte 4 component instantiation API (new App({ target: ... })). This API was removed in Svelte 5 in favor of mount(). As a result, a freshly scaffolded project builds and runs, but the app renders as a blank page, with a runtime error in the browser console.
This happens on a completely fresh project generated with wails init using the svelte-ts template — no manual changes were made. I also checked the svelte (non-TS) template's source on main and it has the identical issue.
To Reproduce
wails init -n my-app -t svelte-ts
cd my-app
wails dev
Open the app (or the dev server URL in a browser) and check the JS console.
Expected Behavior
The scaffolded "Hello World" App.svelte component renders.
Actual Behavior
The app window/page is blank. The browser console shows:
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>
at component_api_invalid_new (chunk-3LSFQATS.js?v=8bf69bab:280:19)
at Module.check_target (chunk-6FN3AOA4.js?v=8bf69bab:390:5)
at new App (App.svelte:1:2)
...
Environment
- Wails CLI: v2.15.0
- Go: go1.26.2 darwin/arm64
- Node: v22.18.0
- npm: 10.9.3
- OS: macOS 26.6 (build 25G72), arm64
- Template:
svelte-ts (also affects svelte)
Root Cause
v2/pkg/templates/templates/svelte-ts/frontend/src/main.ts (and the equivalent v2/pkg/templates/templates/svelte/frontend/src/main.js) on main contains:
import './style.css'
import App from './App.svelte'
const app = new App({
target: document.getElementById('app')
})
export default app
This is the Svelte 4 component API. Svelte 5 (pinned via "svelte": "^5.55.7" in both templates' package.json) removed new Component() for client-side mounting; it must be replaced with mount() from the svelte package. See the Svelte 5 migration guide: Components are no longer classes.
I verified this is still present on main as of 2026-08-19, so it is not yet fixed.
Note: this may be related to / compound with #5989 (vite 8 vs. @sveltejs/vite-plugin-svelte peer conflict) — that issue blocks a fresh install entirely, and once worked around, this Svelte 5 API mismatch surfaces next.
Workaround
Update the bootstrap file to use mount():
import { mount } from 'svelte'
import './style.css'
import App from './App.svelte'
const app = mount(App, {
target: document.getElementById('app')!
})
export default app
Suggested Fix
Update v2/pkg/templates/templates/svelte/frontend/src/main.js and v2/pkg/templates/templates/svelte-ts/frontend/src/main.ts to use the Svelte 5 mount() API instead of new App(...).
To Reproduce
wails init -n my-app -t svelte-ts
cd my-app
wails dev
Expected behaviour
The scaffolded "Hello World" App.svelte component renders.
Screenshots
No response
Attempted Fixes
No response
System Details
# Wails
┌───────────────────┐
| Version | v2.15.0 |
└───────────────────┘
# System
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS | MacOS |
| Version | 26.6 |
| ID | 25G72 |
| Branding | |
| Go Version | go1.26.2 |
| Platform | darwin |
| Architecture | arm64 |
| CPU 1 | Apple M1 Max |
| CPU 2 | Apple M1 Max |
| GPU | Chipset Model: Apple M1 Max Type: GPU Bus: Built-In Total Number of Cores: 24 Vendor: Apple (0x106b) Metal Support: Metal 4 |
| Memory | 64GB |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
# Dependencies
┌────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version |
| Xcode command line tools | N/A | Installed | 2416 |
| Nodejs | N/A | Installed | 22.18.0 |
| npm | N/A | Installed | 10.9.3 |
| *Xcode | N/A | Available | |
| *upx | N/A | Available | |
| *nsis | N/A | Available | |
| |
└─────────────────── * - Optional Dependency ────────────────────┘
# Diagnosis
Optional package(s) installation details:
- Xcode: Available at https://apps.apple.com/us/app/xcode/id497799835
- upx : Available at https://upx.github.io/
- nsis : More info at https://wails.io/docs/guides/windows-installer/
SUCCESS Your system is ready for Wails development!
Additional context
No response
Wails version family
v2
Exact Wails version
v2.15.0
Operating System
macOS
Description
The
svelteandsvelte-tsv2 templates pinsvelte: "^5.55.7", but their generatedmain.js/main.tsstill bootstrap the app using the Svelte 4 component instantiation API (new App({ target: ... })). This API was removed in Svelte 5 in favor ofmount(). As a result, a freshly scaffolded project builds and runs, but the app renders as a blank page, with a runtime error in the browser console.This happens on a completely fresh project generated with
wails initusing thesvelte-tstemplate — no manual changes were made. I also checked thesvelte(non-TS) template's source onmainand it has the identical issue.To Reproduce
Open the app (or the dev server URL in a browser) and check the JS console.
Expected Behavior
The scaffolded "Hello World"
App.sveltecomponent renders.Actual Behavior
The app window/page is blank. The browser console shows:
Environment
svelte-ts(also affectssvelte)Root Cause
v2/pkg/templates/templates/svelte-ts/frontend/src/main.ts(and the equivalentv2/pkg/templates/templates/svelte/frontend/src/main.js) onmaincontains:This is the Svelte 4 component API. Svelte 5 (pinned via
"svelte": "^5.55.7"in both templates'package.json) removednew Component()for client-side mounting; it must be replaced withmount()from thesveltepackage. See the Svelte 5 migration guide: Components are no longer classes.I verified this is still present on
mainas of 2026-08-19, so it is not yet fixed.Note: this may be related to / compound with #5989 (vite 8 vs.
@sveltejs/vite-plugin-sveltepeer conflict) — that issue blocks a fresh install entirely, and once worked around, this Svelte 5 API mismatch surfaces next.Workaround
Update the bootstrap file to use
mount():Suggested Fix
Update
v2/pkg/templates/templates/svelte/frontend/src/main.jsandv2/pkg/templates/templates/svelte-ts/frontend/src/main.tsto use the Svelte 5mount()API instead ofnew App(...).To Reproduce
Expected behaviour
The scaffolded "Hello World" App.svelte component renders.
Screenshots
No response
Attempted Fixes
No response
System Details
Additional context
No response