storybookjs / addon-svelte-csf

[Incubation] CSF using Svelte components.
MIT License
98 stars 29 forks source link

[Bug] Exact same Stories doesn't render same way regarding their location ( ./src/** vs ./node_modules/** ) #183

Open LeMouf opened 1 month ago

LeMouf commented 1 month ago

Describe the bug

Using addon-svelte-csf to create svelte stories, it work perfectly when they are in the src folder tree, but as soon as they are package ( exact same file ) and end up in the node_modules folder tree, it seems to lose something and end up to an errors :

No primary story attached to this docs file, did you forget to use <Meta of={} />?

image

Steps to reproduce the behavior

  1. add a package with component and stories using addon-svelte-csf

  2. add the same components + stories in a forlder in src file tree

  3. configure the main.ts to use the stories of the src and the node_modules folders image

  4. launch storybook, an see the src one working as expected and the node_modules reach an error ( cf: screenshot )

Expected behavior

Same Behavior for the two kind of usage, as for a classic stories this way of doing work without any issues

Environment

JReinhold commented 1 month ago

I suspect this is a duplicate of https://github.com/storybookjs/storybook/issues/27178

Could you try with a some regular, none-Svelte CSF stories and see if it's still an issue?

LeMouf commented 1 month ago

it's look like a similar one but with regular none-Svelte CSF stories it work without any issue. it specificaly broke when i use an addon-svelte-csf one :/

i try the workaround describe in the link you provide without any success for the moment :(

JReinhold commented 1 month ago

Alright.

Could you create a repository with a minimal reproduction of the issue?

You can use https://storybook.new as a template

LeMouf commented 1 month ago

Sure, i have setup a repository and a package to reproduce the bug and illustrate the issue :

repo : https://github.com/LeMouf/nodemodule-svelte-csf

with 2 differents components stories, one classic csf, one with svelte csf both localy in the repo and in the package

Clone the repo

Edit the .npmrc file to setup your personnal authToken

run `npm run storybook`

=> the classic and the svelte csf work fine, for the package only the classic work fine not the svelte one :/

package : https://github.com/LeMouf/package-svelte-csf

Clone the repo

run `npm run storybook`

=> both classic and svelte work fine

Thanks for your help !

LeMouf commented 3 weeks ago

@JReinhold the repo suit your need to test it ?

JReinhold commented 3 weeks ago

Repro looks good. I don't know when I'll have time to look into it as I just had a kid that needs my attention.

Anyone is free to pick this up.

LeMouf commented 3 weeks ago

@JReinhold Congratulations on the arrival of your child, it's normal to prioritize it :) take care of the family