Closed GoodGoodJM closed 2 weeks ago
Also happening with SvelteKit. Quite annoying, because this practically does not allow stories to be placed alongside components. This requires all of my stories to be placed src/stories
instead.
@rChaoz @GoodGoodJM Could you try out Storybook v8.1.0-beta.1 and see if #22545 fixes this issue too?
npx storybook@next upgrade
Unable to index ./src/routes/(auth)/signup/Page.mdx
I get this same error when my docs and stories are in different packages. I'm using Storybook for different frameworks (vue, react, etc.) of a design system. I'd like to share the same docs between all storybooks. The docs work great when they (and related stories) are housed within a single storybook. But when I try to import them from a shared package, I get:
Unable to index ./node_modules/shared-docs/component.doc.mdx:
Error: Invariant failed: Could not find or load CSF file at path "./component.stories" referenced by `of={}` in docs file "./node_modules/shared-docs/component.doc.mdx".
In the above case, .component.stories.js
and component.doc.mdx
are in the same folder. I've checked the questions the error asks me:
.stories.*
)? Yesstories
glob in main.js
? YesBut I can't determine why it won't load successfully. Again, when I move everything into a single package (not pulling from node_modules), things work great.
@stephiescastle your issue sounds different than this, this issue is specifically about parentheses as part of the path to stories.
Could you open a new issue with a reproduction, possibly referencing this comment?
It could be a bug because we globally exclude node_modules
from the story index at https://github.com/storybookjs/storybook/blob/next/code/lib/core-common/src/utils/common-glob-options.ts/#L4
Or it could be because the stories you're referencing are not part of your stories
glob pattern in the main.js
config.
@JReinhold Thanks, I didn't catch the part about the parenthesis.
I checked the reasons you mentioned, and I don't believe those are the problem either. Here is the issue I created with a reproduction repo: https://github.com/storybookjs/storybook/issues/27178
@GoodGoodJM I cloned the repo you linked, then I:
pnpm
to installAnd then storybook opened without any problems
I checked if it truly worked by editing src/routes/(app)/+page.svelte
:
Could you have a look at if this problem indeed still exists?
@ndelangen Just checked, the issue seems to be fixed for me on v8.2.6
Describe the bug
Cannot load CSF when it is placed in route group.
For example:
It be occured error
After a few attempts, i checked that error occurred if stories were in the route group, regardless of the location of the MDX.
If i move stories file out of group(like
src/routes/temp
), Cannot find any ploblems.To Reproduce
See: stackblitz repo
System
No response
Additional context
No response