-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
I just noticed that any plain on…="…" attributes (e.g. onclick="…") in component html will break the build if there are still deprecated on:… (e.g. on:click="…") attributes present in the same file, but with an obscure error message:
error during build:
undefined
A fix of course is to only use exclusively the new or deprecated syntax -- but I guess there is some compiler problem or at least an opportunity for a better error message :)
This might be a fix for #13883.
Reproduction
$ npm create vite@latest
✔ Select a framework: › Svelte
✔ Select a variant: › JavaScript
$ npm install
$ npm run build
vite v5.4.10 building for production...
…
✓ built in 174ms
# Add any on-attribute, e.g.
$ vi src/App.svelte
<div onclick={() => console.log('hi')}>
$ npm run build
vite v5.4.10 building for production...
✓ 51 modules transformed.
x Build failed in 84ms
error during build:
undefined
Logs
see reproductionSystem Info
Node: 22.8.0
npm: 10.8.2
@sveltejs/vite-plugin-svelte: 4.0.0
svelte: 5.1.1
vite: 5.4.10Severity
annoyance
rChaoz, foxdrodd and emanusantosSup2point0
Metadata
Metadata
Assignees
Labels
No labels