Source-loader: Breaks when stories reference other stories before they are defined
See original GitHub issueDescribe the bug waring: @storybook/source-loader was applied to a file which does not contain a story. Please check your webpack configuration and make sure to apply @storybook/source-loader only to files containg stories. Related file:"
To Reproduce Steps to reproduce the behavior:
- run is repo
Expected behavior no waring
Screenshots
Code snippets
export function AllButton() {
return (
<>
<DefaultButton />
<PrimaryButton />
<SuccessButton />
</>
);
}
export function DefaultButton() {
return (
<Button
onClick={action("clicked")}
text={text("Default Button", "Default Button")}
/>
);
}
export function PrimaryButton() {
return (
<Button
onClick={action("clicked")}
text={text("Primary Button", "Primary Button")}
type="primary"
/>
);
}
export function SuccessButton() {
return (
<Button
onClick={action("clicked")}
text={text("Success Button", "Success Button")}
type="success"
/>
);
}
System:
Environment Info:
System:
OS: macOS 10.15.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 13.12.0 - ~/.nvm/versions/node/v13.12.0/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v13.12.0/bin/npm
Browsers:
Chrome: 80.0.3987.163
Safari: 13.1
npmPackages:
@storybook/addon-actions: ^5.3.18 => 5.3.18
@storybook/addon-console: ^1.2.1 => 1.2.1
@storybook/addon-docs: ^5.3.18 => 5.3.18
@storybook/addon-knobs: ^5.3.18 => 5.3.18
@storybook/addon-links: ^5.3.18 => 5.3.18
@storybook/addon-notes: ^5.3.18 => 5.3.18
@storybook/addons: ^5.3.18 => 5.3.18
@storybook/preset-create-react-app: ^2.1.1 => 2.1.1
@storybook/react: ^5.3.18 => 5.3.18
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:21 (7 by maintainers)
Top Results From Across the Web
Source-loader: Breaks when stories reference other ...
Describe the bug waring: @storybook/source-loader was applied to a file which does not contain a story. Please check your webpack configuration and make ......
Read more >Space Breaks in Fiction
The Anatomy of a Break. Section breaks in Less are signaled primarily by a blank line space between paragraphs. In other books, this...
Read more >Story Arcs: Definitions and Examples of the 6 Shapes ...
Researchers have found six common story arcs in literature. In this article, see which arc fits your story best and how to use...
Read more >Analyzing Novels & Short Stories - TAMU Writing Center
Literary analysis looks critically at a work of fiction in order to understand how the parts contribute to the whole. When analyzing a...
Read more >How to Write a Short Story in 12 Concrete Steps [Examples]
Remember that becoming a successful author is a journey, many start with short stories, blogging, or even poetry before going on to writing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m able to repro in the original repo. How I worked around it:
export function Foo
toexport const Foo =
All
story to the end of the file so that it is defined AFTER the stories it referencesI’m seeing even worse behavior in 6.0-beta. Renaming the issue and calling this a bug.
I’m using beta.29 and I have defined all of my components before referencing them:
I still see the console warning.