EMH333 / esbuild-svelte

An esbuild plugin to compile Svelte components
https://www.npmjs.com/package/esbuild-svelte
MIT License
245 stars 24 forks source link

esbuild-svelte: "p has already been declared" error when using @threlte/core with Svelte 5 #260

Open hussienliban opened 1 day ago

hussienliban commented 1 day ago

Describe the bug When building a project using @threlte/core with esbuild-svelte, multiple "p has already been declared" errors are occurring in the Canvas.svelte and T.svelte components from the @threlte/core package.

To Reproduce Steps to reproduce the behavior:

Have a project using @threlte/core for 3D rendering in Svelte Build the project with esbuild-svelte plugin See multiple errors stating "p has already been declared" in:

@threlte/core/dist/Canvas.svelte @threlte/core/dist/components/T/T.svelte

Expected behavior The build should complete successfully without any variable redeclaration errors.

Screenshots

✘ [ERROR] `p` has already been declared [plugin esbuild-svelte]
    node_modules/.pnpm/@threlte+core@8.0.0-next.31_svelte@5.2.7_three@0.170.0/node_modules/@threlte/core/dist/Canvas.svelte:6:9

Environment (please complete the following information):