ERROR in ./.storybook/addons.js
Module build failed: Error: Couldn't find preset "./packages/babel-preset-foo" relative to directory "/Users/Vaughan/dev-live/foo/.storybook"
Project tree:
- .babelrc
- packages
- babel-preset-foo
_.babelrc_
{"presets": ["./packages/babel-preset-foo"]}
"@storybook/react": "^3.3.9",
"@storybook/addon-actions": "^3.3.9",
"@storybook/addon-links": "^3.3.9",
"@storybook/addons": "^3.3.9"
Simple fix was to add a .babelrc file to .storybook/ and correct the relative preset path.
This didn't actually solve my problem. It appears that babel tries to read relative presets from the dir of the file it is processing. So the preset path would need to be absolute, but this is not possible because .babelrc is static...
It's not happening with the rest of my app, so I am wondering if its a storybook config setting.
Seems related to https://github.com/storybooks/storybook/issues/172
I am using:
{
"extends": "../.babelrc"
}
This resolves the errors for now.
The extends rewriting should also be added for presets and plugins perhaps:
Also related: #2610 #2582
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!
Released as 4.0.0-alpha.20
Most helpful comment
Seems related to https://github.com/storybooks/storybook/issues/172
I am using:
This resolves the errors for now.