-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Description
Describe the bug
I am pretty sure I am doing this right, but still get a warning where I can clearly see that the module is in fact used.
I have a simple debug component that uses Shiki in my $effect
block, but my warning says "codeToHtml" is imported from external module "shiki" but never used in "src/routes/Debug.svelte".
I don't get any errors when developing, only when building (npm run build
). Maybe it is an issue with Vite and Rollup?

Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-guwbyqsc?file=src%2Froutes%2FDebug.svelte
Run npm run build
in the terminal to see the warning.
Logs
❯ npm run build
> kit-template-default@0.0.1 build
> vite build
vite v7.0.6 building SSR bundle for production...
"codeToHtml" is imported from external module "shiki" but never used in "src/routes/Debug.svelte".
✓ 166 modules transformed.
vite v7.0.6 building for production...
✓ 515 modules transformed.
System Info
Developing on MacOS (latest), Node v22.
Can replicate on fresh project on StackBlitz.
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels