SvelteKit Storybook TypeScript Package Import Issue #29685
Unanswered
Snuffkin1234
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Hello,
I'm working on a component library in SvelteKit using Svelte 5, TypeScript, and Storybook 8.4. My tsconfig is set to Nodenext, which has the side effect of requiring file extensions on imports. Sometimes Storybook works fine, and sometimes I get an error like this,
[plugin:vite:import-analysis] Failed to resolve import "../enums/cssClasses/cardClasses.js" from "src/package/components/ClickableCard.svelte". Does the file exist?
The file is literally
cardClasses.ts
, but I need to import it ascardClasses.js
, so the package will work after runningsvelte-package
. How can I make this work with Storybook?I could just point Storybook at the
dist
folder instead ofsrc
but that would remove a lot of the usefulness of Storybook for incremental debugging.Thanks!
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions