Skip to content
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

Add warning when module is missing in storiesOf #1525

Merged
merged 1 commit into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/react/src/client/preview/client_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export default class ClientApi {
throw new Error('Invalid or missing kind provided for stories, should be a string');
}

if (!m) {
// eslint-disable-next-line no-console
console.warn(
`Missing 'module' parameter for story with a kind of '${kind}'. It will break your HMR`
);
}

if (m && m.hot) {
m.hot.dispose(() => {
this._storyStore.removeStoryKind(kind);
Expand Down
4 changes: 4 additions & 0 deletions app/vue/src/client/preview/client_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default class ClientApi {
throw new Error('Invalid or missing kind provided for stories, should be a string');
}

if(!m) {
console.warn(`Missing 'module' parameter for story with a kind of '${kind}'. It will break your HMR`);
}

if (m && m.hot) {
m.hot.dispose(() => {
this._storyStore.removeStoryKind(kind);
Expand Down
1 change: 0 additions & 1 deletion lib/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"react-komposer": "^2.0.0",
"react-modal": "^1.7.7",
"react-split-pane": "^0.1.63",
"react-split-pane": "^0.1.65",
"redux": "^3.6.0"
},
"devDependencies": {
Expand Down