Skip to content

Commit

Permalink
fix: remove checks. fixes #1252
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed May 20, 2019
1 parent aa77458 commit 2b2f733
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hot.dev.js
Expand Up @@ -64,16 +64,19 @@ const makeHotExport = (sourceModule, moduleId) => {
});
}
}
} else {
logger.warn('React-hot-loader: Hot Module Replacement is not enabled');
}
};

const hot = sourceModule => {
if (!sourceModule || !sourceModule.hot) {
if (!sourceModule) {
// this is fatal
throw new Error('React-hot-loader: `hot` could not find the `hot` method in the `module` you have provided');
throw new Error('React-hot-loader: `hot` was called without any argument provided');
}
const moduleId = sourceModule.id || sourceModule.i || sourceModule.filename;
if (!moduleId) {
console.error('`module` prodived', sourceModule);
throw new Error('React-hot-loader: `hot` could not find the `name` of the the `module` you have provided');
}
const module = hotModule(moduleId);
Expand Down

0 comments on commit 2b2f733

Please sign in to comment.