sveltekit-knip-dynamic-import-repro Svelte Themes

Sveltekit Knip Dynamic Import Repro

Knip reproduction

This is a small svelte kit project to reproduce an issue with dymanic imports in Knip.

Knip version: ^5.66.4

Issue description

I've created an Error.svelte component that is lazy loaded in the src/routes/+page.svelte component:

{#await import("./Error.svelte") then Err}
  <Err.default />
{/await}

When running npm run knip it says that Error.svelte is an unused file.

Steps to reproduce

  1. Clode this repo
  2. Install dependencies (npm install)
  3. Run npm run knip

Top categories

Loading Svelte Themes