Skip to content

"(x) is imported from external module but never used" with $effect #16507

@ngblaylock

Description

@ngblaylock

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?

Image

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

> [email protected] 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

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