-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
[Bug]: "Could not find CSF file at path" error with Vite builder #22619
Comments
I'm facing the same problem, but for me it was a weird behavior: it was working fine but this error was logging on console, then at a sudden it crashed. I thought it was some change I made, then started to comment/uncomment some parts of the story until it worked again with the same code as before (but still with the console error). The error also contains After a while, probably a coincidence, but when I resized the window it crashed again. Tried to clean all caches but without success for now. I was using the 7.0.7 version, then upgrade to 7.0.12 but the behavior is the same. |
@dimafirsov in your example, I was able to make it work by adding a |
In my case, just discovered that it was the typings inside my story. I had something like: export const Default: Story = {
args: {},
render: args => ({
template: '',
setup() {
const groups = [
{
items: <ItemProps>{ // this typing
prop: '',
},
}
return {
args,
groups
};
}
})
}; changed to |
Thanks for the help @fsblemos! Not sure how you made it work with Also, I'm seing this a lot in the console
This looks weird because it seems that all three requirements are reached. |
This error message needs work. cc @yannbf @JReinhold What's going on is the following:
In @dimafirsov 's reproduction, you can see this error by navigating to the story:
You need to In @fsblemos it was a typo in the story file. We should improve the error message in this case to make it more obvious what's going on and link to instructions for how to debug it. |
Thanks @shilman, your solution fixed my issue! Developing in const meta = { ...blah }
export default meta to export default { ...blah } where Storybook was able to detect the file properly :)
It seems like the |
Thanks @shilman for the clarification on the issue! Just wanted to note that MDX + CSF automigration command from the docs creates these incorrectly formatted CSF files during the mirgarion process for mdx files. |
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.20 containing PR #22782 that references this issue. Upgrade today to the
|
Still getting this error with 7.3.2 |
Still getting this error with 7.4.2 |
Describe the bug
After installing Storybook V7 on a clean Vite project I added to
src
folder an arbitrary.mdx
file with a reference to its corresponding CSF.stories
file, just like it is shown in the docs:Unexpectedly, when the storybook started, I got an error saying it could not find the CSF file despite it being there.
Could not find CSF file at path "./HelloWorld.stories" referenced by
of={}in docs file "src/stories/HelloWorld.mdx"
I didn't touch the
stories
paths inmain.js
which seemed to be correct.P.S. In my real project I used the MDX + CSF automigration command
npx storybook@latest migrate mdx-to-csf --glob "src/**/*.stories.mdx"
which resulted in the same file structure and contents, and lead to the same issues.
To Reproduce
https://stackblitz.com/edit/github-477zbc?file=src%2Fstories%2FHelloWorld.mdx
System
Additional context
No response
The text was updated successfully, but these errors were encountered: