Skip to content

Commit 49df8cb

Browse files
authored
Avoid this[MODULE_TYPE] is not a function error
Following webpack-contrib#73 (comment)
1 parent ffb0d87 commit 49df8cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/loader.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ export function pitch(request) {
124124
};
125125
});
126126
}
127+
if(typeof this[MODULE_TYPE] !== "function") {
128+
return callback(new Error("It seems you are using the loader but forgot to register the plugin"));
129+
}
127130
this[MODULE_TYPE](text);
128131
} catch (e) {
129132
return callback(e);

0 commit comments

Comments
 (0)