Skip to content

fix(v2/templates): bump vite-plugin-svelte for Vite 8 peer range - #6007

Open
haoku123 wants to merge 1 commit into
wailsapp:masterfrom
haoku123:fix/v2-svelte-template-vite8-peer
Open

fix(v2/templates): bump vite-plugin-svelte for Vite 8 peer range#6007
haoku123 wants to merge 1 commit into
wailsapp:masterfrom
haoku123:fix/v2-svelte-template-vite8-peer

Conversation

@haoku123

@haoku123 haoku123 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #5989

Problem

Fresh v2 svelte and svelte-ts projects fail npm install with ERESOLVE:

npm error peer vite@"^6.3.0 || ^7.0.0" from @sveltejs/vite-plugin-svelte@6.2.4
npm error   dev @sveltejs/vite-plugin-svelte@"^6.0.0" from the root project

The templates declare vite: ^8.0.13, which now resolves to 8.2.1, while @sveltejs/vite-plugin-svelte: ^6.0.0 resolves to 6.2.4. That plugin's published peer range is vite ^6.3.0 || ^7.0.0, so npm rejects the tree.

Fix

Bump the plugin to ^7.3.0 in both templates. Its peer range is vite ^8.0.0-beta.7 || ^8.0.0, and it requires svelte ^5.46.4, already satisfied by the templates' existing svelte: ^5.55.7. No other dependency needed changing.

Verification

Against the acceptance criteria in #5989:

  • Fresh projects install without --force / --legacy-peer-deps. Both templates npm install cleanly (found 0 vulnerabilities).

  • Supported peer combination. vite-plugin-svelte@7.3.0 + vite@8.2.1 + svelte@5.x resolve with no peer warnings.

  • Both generated projects build. npm run build succeeds for both on a clean npm cache:

    dist/assets/index-BT2uU9Kw.js   24.59 kB │ gzip: 10.01 kB
    ✓ built in 1.18s
    
  • Change limited to the required compatibility fix. Two lines, one per template.

Testing note: I generated each template's index.html from index.tmpl.html to reproduce a post-generation project, since the raw template dir has no index.html.

Pre-existing, not addressed here

npm run check in svelte-ts reports one svelte-check error:

Error: Type 'HTMLElement | null' is not assignable to type 'Document | Element | ShadowRoot'.
  const app = new App({ target: document.getElementById('app') })

This reproduces on master with the old ^6.0.0 plugin (installed via --legacy-peer-deps), so it predates this change and is out of scope per the last acceptance criterion. Happy to fix it in a separate PR if useful.

Summary by CodeRabbit

  • Chores
    • Updated the Svelte Vite plugin to a newer version in Svelte frontend templates.
    • Keeps generated Svelte projects aligned with the latest supported tooling.

Fresh v2 `svelte` and `svelte-ts` projects fail `npm install` with
`ERESOLVE`: the templates pin `vite: ^8.0.13` (resolving to 8.2.1) while
`@sveltejs/vite-plugin-svelte: ^6.0.0` resolves to 6.2.4, whose peer range
is `vite ^6.3.0 || ^7.0.0`.

Bump the plugin to `^7.3.0`, whose peer range is
`vite ^8.0.0-beta.7 || ^8.0.0`. It requires `svelte ^5.46.4`, already
satisfied by the templates' `svelte: ^5.55.7`.

Verified both generated templates install without `--force` or
`--legacy-peer-deps` and build successfully on a clean npm cache.

Closes wailsapp#5989
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 54c4ab46-8ad5-4f95-981a-ca4203898270

📥 Commits

Reviewing files that changed from the base of the PR and between b84f422 and 3a22aaa.

📒 Files selected for processing (2)
  • v2/pkg/templates/templates/svelte-ts/frontend/package.json
  • v2/pkg/templates/templates/svelte/frontend/package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The Svelte and Svelte TypeScript frontend templates update @sveltejs/vite-plugin-svelte from ^6.0.0 to ^7.3.0.

Changes

Svelte template dependency update

Layer / File(s) Summary
Update Svelte Vite plugin constraint
v2/pkg/templates/templates/svelte/frontend/package.json, v2/pkg/templates/templates/svelte-ts/frontend/package.json
Both template manifests update @sveltejs/vite-plugin-svelte to ^7.3.0.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 3a22a

The templates update their Svelte Vite plugin to a version compatible with Vite 8, addressing fresh-install failures while preserving the existing Svelte dependency range. No actionable merge-blocking risk remains after normal checks and review.

Possibly related issues

Possibly related PRs

  • wailsapp/wails#5385 — Both changes update @sveltejs/vite-plugin-svelte in the Svelte frontend templates.

Poem

A rabbit hops through templates bright,
And bumps the plugin version right.
Svelte and TypeScript share the tune,
From six to seven beneath the moon.
“Builds are fresh!” the rabbit sings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Svelte Vite plugin update and its purpose: compatibility with the Vite 8 peer range.
Description check ✅ Passed The description explains the problem, fix, issue reference, dependencies, verification steps, test results, and pre-existing out-of-scope behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2] Svelte templates fail install after Vite 8.2.1 resolution

1 participant