storybook
storybook copied to clipboard
context.parameters.fileName is different in static build
Describe the bug
When using context
the parameters.fileName
is the actual path (e.g. /folder/Button-story.js) in development but will switch to a number (e.g. 1021) in static production build.
To Reproduce Steps to reproduce the behavior: Output context in production build.
Expected behavior context should be the same in development and production
Code snippets
export const withNotes = makeDecorator({
wrapper: (context) => {
console.log(context.parameters.fileName);
});
System:
- Version: 5.1.8
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 30 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!
I have the same question. Is there a way to get filename
in a build?
Me too! Breaks my addon
bump
Same here. Still a bug in 6.1
@gavmck @imdongchen @Utzel-Butzel @shilman I found the workaround here https://github.com/storybookjs/storybook/issues/5907#issuecomment-470015950 Thought it should be already fixed, but as I've mentioned, it's still an issue in 6.1.
I guess if a project wants to use it's own webpack config, it will most likely turn on optimization and get caught on this bug. I suppose it would be helpful to point this out in the documentation.