#Storysource not working with Vite
37 messages · Page 1 of 1 (latest)
Storysource not working with Vite
Note that I am using Svelte, could that be why?
Hm, I'm not sure. Thanks for bringing this up. You said above "with any framework", did you try with something other than svelte?
Technically Vue
but not React admittedly
Will try react now
Switched to my Linux machine.
Btw, it also doesnt work on 6.5.13
ok, that's helpful, thanks.
Maybe you can create a small reproduction and file an issue, and tag me on it?
thanks
I have already created an issue, will add onto it and tag you
thanks!
Alright just tested it on Vue again, it seems to be sort of working on Vue
It is just a Svelte thing.
will change issue
Are you using svelte-native stories? (using https://www.npmjs.com/package/@storybook/addon-svelte-csf?)
No, but I will attempt this and report back
I'm not suggesting you should try it, sorry, just wondering if that could be a reason.
It could very well be the reason. It is possible that the reason the story source is not loading is because I am using the old method
using something like:
args {
bla : 123
}
instead of
<ActualComponent actualprop="foo"></ActualComponent>
addon-svelte-csf isn't necessarily the "new" way. It's an alternative, and actually, writing your stories using it can result in less functionality because it doesn't work well with some of the rest of storybook features
I see.
But it appears that I may have been approaching things the wrong way. It appears storysource does not actually display the source code for the SFC that is the .svelte file
but just the code of the story which might not be what I want.
I just want a nice area in SB which conveniently shows my true svelte source code
But it is not too much of a big deal, my developers and I can simply view the files directly.
@warm stag Is it a known limitation that storysource does not show svelte SFC files? I'm guessing so.
Sounds plausible. You might be able to set the docs.source.type parameter to ‘dynamic’ and see what that does
export default {
title: 'Components/CTACard',
component: CTACard,
tags: ['docsPage'],
render: (args) => ({
Component: CTACard,
props: args,
}),
parameters : {
docs : {
source : {type : 'dynamic' }
}
}
};
like that?
Ok I did that as well as this and it doesnt work so oh well
export const Primary = Template.bind({});
Primary.parameters = {
docs: {
source: {
type: "dynamic",
},
},
};