Merge pull request #1525 from storybooks/hmr-warning-on-storiesOf

Add warning when module is missing in storiesOf
This commit is contained in:
igor-dv 2017-07-26 11:46:59 +03:00 committed by GitHub
commit 949f62f08c
3 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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": {