I just updated to svelte@5.0.0-next.47 and it broke my app. It keeps throwing that some imports are duplicated but they are not. I had to go back to svelte@5.0.0-next.45. Hopefully I committed my bun.lockb file to Git before updating. Here's an snippet of the error message:
{
name: 'CompileError',
id: '/Users/jgb/Code/JGB/Web/mp3pam-svelte/src/lib/components/Player.svelte',
message: "/Users/jgb/Code/JGB/Web/mp3pam-svelte/src/lib/components/Player.svelte:1:27 'trpcClient' has already been declared",
frame: '1 | <script lang="ts">\n' +
"2 | \timport { trpcClient } from '$lib/trpc/client'\n" +
' | ^\n' +
"3 | \timport Container from './Container.svelte'\n" +
"4 | \timport { page } from '$app/stores'",
code: 'duplicate-declaration',
stack: "CompileError: 'trpcClient' has already been declared\n" +
' at error (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/errors.js:532:8)\n' +
' at Scope.declare (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/phases/scope.js:98:4)\n' +
' at Scope.declare (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/phases/scope.js:92:25)\n' +
' at Scope.declare (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/phases/scope.js:92:25)\n' +
' at Scope.declare (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/phases/scope.js:92:25)\n' +
' at Scope.declare (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/phases/scope.js:92:25)\n' +
' at ImportDeclaration (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/svelte/src/compiler/phases/scope.js:417:17)\n' +
' at visit (file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/zimmerframe/src/walk.js:121:13)\n' +
' at file:///Users/jgb/Code/JGB/Web/mp3pam-svelte/node_modules/zimmerframe/src/walk.js:52:25\n' +
' at Array.forEach (<anonymous>)',
loc: {
line: 1,
column: 27,
file: '/Users/jgb/Code/JGB/Web/mp3pam-svelte/src/lib/components/Player.svelte'
},
plugin: 'vite-plugin-svelte',
pluginCode: '<script lang="ts">\n' +
"\timport { trpcClient } from '$lib/trpc/client'\n" +
Reproduction
I ran bun update to update all the packages. I got svelte@5.0.0-next.47. The app broke.
Quick update: I saw @Rich-Harris pushed an update to svelte@5.0.0-next.48 and I'm not sure if that fixes it. But I'm not ready to test that now.
Describe the bug
I just updated to
svelte@5.0.0-next.47
and it broke my app. It keeps throwing that some imports are duplicated but they are not. I had to go back tosvelte@5.0.0-next.45
. Hopefully I committed mybun.lockb
file to Git before updating. Here's an snippet of the error message:Reproduction
I ran
bun update
to update all the packages. I gotsvelte@5.0.0-next.47
. The app broke.Quick update: I saw @Rich-Harris pushed an update to
svelte@5.0.0-next.48
and I'm not sure if that fixes it. But I'm not ready to test that now.Logs
Error logs
```shell { name: 'CompileError', id: '/Users/jgb/Code/JGB/Web/mp3pam-svelte/src/lib/components/Player.svelte', message: "/Users/jgb/Code/JGB/Web/mp3pam-svelte/src/lib/components/Player.svelte:1:27 'trpcClient' has already been declared", frame: '1 | \n' + '\n' + 'System Info
Severity
blocking all usage of svelte
Can you please wrap your logs in a collapsible section because it's so long right now that it makes the thread hard to use
"Update the the latest version with
bun update
." is not a reproduction. Please provide a minimal reproduction, as requested in the issue template.I fixed it thanks
I added more details but I'm not ready to provide reproduction repo right now. Thanks though!
Can you try with the latest version? There was a bug in 47 that affected compilation in a broad manner.
@dummdidumm In my case the problem is fixed in 48. But I still see TS errors in the snippet block for some reason...
Did you restart vscode?
@Zachiah yep, very likely the same issue https://github.com/sveltejs/language-tools/issues/2281
@dummdidumm I can confirm that updating to
svelte@5.0.0-next.48
indeed fixed the issue. I'm closing it. Thanks all!