From 49df8cb10d15af6c17444cac35260d155d2612ff Mon Sep 17 00:00:00 2001 From: MoOx Date: Mon, 26 Nov 2018 18:11:10 +0100 Subject: [PATCH 1/3] Avoid `this[MODULE_TYPE] is not a function` error Following https://github.com/webpack-contrib/mini-css-extract-plugin/issues/73#issuecomment-441717981 --- src/loader.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/loader.js b/src/loader.js index 9801d590..c16f162f 100644 --- a/src/loader.js +++ b/src/loader.js @@ -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); From 59da9f87744f5f35400261b5c2f3937f97c5ac67 Mon Sep 17 00:00:00 2001 From: Naoise Golden Santos Date: Tue, 18 Dec 2018 18:10:53 +0100 Subject: [PATCH 2/3] Update src/loader.js Co-Authored-By: MoOx --- src/loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loader.js b/src/loader.js index c16f162f..caed2ceb 100644 --- a/src/loader.js +++ b/src/loader.js @@ -124,7 +124,7 @@ export function pitch(request) { }; }); } - if(typeof this[MODULE_TYPE] !== "function") { + 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); From 07bd40eec209cb71e16f3be844294cee7e61cb05 Mon Sep 17 00:00:00 2001 From: Naoise Golden Santos Date: Tue, 18 Dec 2018 18:11:02 +0100 Subject: [PATCH 3/3] Update src/loader.js Co-Authored-By: MoOx --- src/loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loader.js b/src/loader.js index caed2ceb..7a5f0bdd 100644 --- a/src/loader.js +++ b/src/loader.js @@ -125,7 +125,7 @@ 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")); + return callback(new Error('It seems you are using the loader but forgot to register the plugin')); } this[MODULE_TYPE](text); } catch (e) {