-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π§ Sveltekit: Can't import Sveltekit modules in components (i.e. $path) #384
Comments
|
related issues: #241 edit: made repro easier to understand |
Am having the same issue, I am trying to resolve the import { defineConfig, defaultColors } from 'histoire';
import { HstSvelte } from '@histoire/plugin-svelte';
import { resolve } from 'path';
export default defineConfig({
setupFile: './histoire-setup.js',
theme: {
title: 'Qomino Design System',
colors: {
primary: defaultColors.cyan,
},
favicon: './static/favicon.svg',
},
vite: {
resolve: {
alias: {
'$lib': resolve('.src/lib'),
'@components': resolve('./src/lib/components'),
'@utils': resolve('./src/lib/utils'),
'@icons': resolve('./src/lib/icons'),
+ '$app/stores': resolve('./node_modules/@sveltejs/kit/types'), // <-- how to resove this?
},
}
},
plugins: [HstSvelte()],
});
|
@benzara-tahar Thanks for posting a possible workaround! I was sifting through the docs earlier and saw this so figured I'd post it here |
I hope this will be fixed if we leave SvelteKit's setup plugin in place and remove it's compile plugin. See my comment here: #393 (comment) |
Thanks for giving this one attention @benmccann ! Sveltekit + Histoire are a match made in heaven :) I'll follow that thread and help test where I can |
@Akryum , this bug still exists |
Some SvelteKit modules will work and some won't. You can see a summary here: https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit#supported-features |
Describe the bug
When trying to import Sveltekit Modules such as the
$path
store in a component,β I get an error in Histoire
(port 6006)
β I don't get an error in Sveltekit
(port 5173)
.Stackblitz Repro:
https://stackblitz.com/edit/sveltejs-kit-template-default-9wclu1?file=src/lib/PageTitle/PageTitle.svelte
sveltekit-histoire-bug.webm
Error
Reproduction
Stackblitz Repro:
https://stackblitz.com/edit/sveltejs-kit-template-default-9wclu1?file=src/lib/PageTitle/PageTitle.svelte
System Info
OS:
Windows 11 Pro (build - 22000.1219)
Browser:
Chrome - Version 107.0.5304.122 (Official Build) (64-bit)
Node:
18.8.0
PNPM:
7.17.1
Terminal:
Git Bash
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: