-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
@storybook/addon-storyshots supports only main.js #9576
Comments
The file is never |
Thanks for the reply, @shilman. I assume it then works by accident? I’ll update my repo. |
Does it really work?! 😱 If so, sorry for the misinformation. Reopening this. |
Well, at least For now I've gotten along by converting to Looking at the source, it seems
Let me confirm this to you tomorrow since I managed to fix everything related to the 5.3 migration, but using a |
I can confirm this problem. Since the update to 5.3 the following storyshots test file does no longer find any stories: import initStoryshots from '@storybook/addon-storyshots'
const registerRequireContextHook = require('babel-plugin-require-context-hook/register')
registerRequireContextHook()
initStoryshots({
framework: 'vue',
configPath: './config/storybook/'
})
I also use a |
So |
Sorry that I never replied to this. Any idea when the fix would be merged? |
Sorry, completely forgot about this. 🙈 Merging now! |
Cool, working now! Although it seems only |
I came here looking for an issue for not working "export default". @iiroj, do you want to open a new issue for that bug? |
Describe the bug
The
getMainFile
method of the storyshots addon has a hardcoded name for the new configuration style for version 5.3 ofmain.js
. This prevents usage of TypeScript, for example, where the file ismain.ts
.You can see the file name here:
storybook/addons/storyshots/storyshots-core/src/frameworks/configure.ts
Line 47 in 76c3f3a
It seems the
getPreviewFile
method correctly supports both JS and TS files.This results in storyshots failing with
storyshots found 0 stories
.If I edit this method to also include TS files, it seems to start working again:
The text was updated successfully, but these errors were encountered: