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

Core: Check module type in configure #8412

Merged
merged 2 commits into from Oct 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/core/src/client/preview/start.js
Expand Up @@ -440,6 +440,11 @@ export default function start(render, { decorateStory } = {}) {
* @param {*} framework - name of framework in use, e.g. "react"
*/
const configure = (loadable, m, framework) => {
if (typeof m === 'string') {
throw new Error(
`Invalid module '${m}'. Did you forget to pass \`module\` as the second argument to \`configure\`"?`
);
}
if (m && m.hot && m.hot.dispose) {
({ previousExports = new Map() } = m.hot.data || {});

Expand Down