Skip to content

Commit

Permalink
Avoid this[MODULE_TYPE] is not a function error
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Nov 26, 2018
1 parent ffb0d87 commit 49df8cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ export function pitch(request) {
};
});
}
if(typeof this[MODULE_TYPE] !== "function") {
return callback(new Error("It seems you are using the loader but forgot to register the plugin"));
}
this[MODULE_TYPE](text);
} catch (e) {
return callback(e);
Expand Down

0 comments on commit 49df8cb

Please sign in to comment.