Skip to content

Running into an issue while using esbuild-svelte and svelte-preprocess with svelte 5 #668

Open
@christophertrudel

Description

@christophertrudel

Describe the bug

[ERROR] [svelte-preprocess] Encountered type error [plugin esbuild-svelte]

    node_modules/runed/dist/utilities/debounced/index.js:1:14:
      1 │ export * from "./debounced.svelte.js";
        ╵               ~~~~~~~~~~~~~~~~~~~~~~~
Image

To Reproduce
Using shadcn-svelte with live_svelte and when running the server esbuild fails with the described error. I have narrowed it down to debounced.svelte.js which contains a comment that references

<script lang="ts">

This seems to be the trigger of the issue that is likely not being properly handled in svelte-preprocess. I have created a patch package to unblock but wanted to report to see if anybody has any idea where the root cause might be?

patch:

diff --git a/node_modules/runed/dist/utilities/debounced/debounced.svelte.js b/node_modules/runed/dist/utilities/debounced/debounced.svelte.js
index c8175e7..c541c4b 100644
--- a/node_modules/runed/dist/utilities/debounced/debounced.svelte.js
+++ b/node_modules/runed/dist/utilities/debounced/debounced.svelte.js
@@ -12,7 +12,7 @@ import { noop } from "../../internal/utils/function.js";
  *
  * @example
  *
- * <script lang="ts">
+ * <script>
  *   import { Debounced } from "runed";
  *
  *   let search = $state("");

Information about your project:

System:
OS: macOS 15.1.1
CPU: (12) arm64 Apple M3 Pro
Memory: 94.34 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
pnpm: 10.9.0 - /opt/homebrew/bin/pnpm
bun: 1.2.10 - /opt/homebrew/bin/bun
Browsers:
Brave Browser: 119.1.60.114
Chrome: 135.0.7049.97
Safari: 18.1.1
npmPackages:
svelte: ^5.28.2 => 5.28.2
svelte-preprocess: ^6.0.3 => 6.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions