From 43c8a14805b19d2f07d0c97177d390e8c4b4ea28 Mon Sep 17 00:00:00 2001 From: Matyas Kandl Date: Fri, 12 Oct 2018 11:44:20 +0200 Subject: [PATCH] make it work with create-react-app v2 --- loaders/include.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loaders/include.js b/loaders/include.js index a0a02b32..74d9027c 100644 --- a/loaders/include.js +++ b/loaders/include.js @@ -6,7 +6,9 @@ module.exports.pitch = function pitch(remainingRequest) { // HACK: NamedModulesPlugin overwrites existing modules when requesting the same module via // different loaders, so we need to circumvent this by appending a suffix to make the name unique // See https://github.com/webpack/webpack/issues/4613#issuecomment-325178346 for details - this._module.userRequest = `include-loader!${this._module.userRequest}`; + if (this._module && this._module.userRequest) { + this._module.userRequest = `include-loader!${this._module.userRequest}`; + } return [ ...(globals