Skip to content

Commit

Permalink
Merge pull request #1525 from storybooks/hmr-warning-on-storiesOf
Browse files Browse the repository at this point in the history
Add warning when module is missing in storiesOf
  • Loading branch information
igor-dv authored Jul 26, 2017
2 parents de75c5d + d6f1b89 commit 949f62f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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

0 comments on commit 949f62f

Please sign in to comment.