{"action":"closed","issue":{"url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/issues/727","repository_url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin","labels_url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/issues/727/labels{/name}","comments_url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/issues/727/comments","events_url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/issues/727/events","html_url":"https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/727","id":300241426,"number":727,"title":"[4.0.0-alpha.0] Cannot read property 'moduleExports' of undefined","user":{"login":"tzimmermann","id":1227637,"avatar_url":"https://avatars1.githubusercontent.com/u/1227637?v=4","gravatar_id":"","url":"https://api.github.com/users/tzimmermann","html_url":"https://github.com/tzimmermann","followers_url":"https://api.github.com/users/tzimmermann/followers","following_url":"https://api.github.com/users/tzimmermann/following{/other_user}","gists_url":"https://api.github.com/users/tzimmermann/gists{/gist_id}","starred_url":"https://api.github.com/users/tzimmermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzimmermann/subscriptions","organizations_url":"https://api.github.com/users/tzimmermann/orgs","repos_url":"https://api.github.com/users/tzimmermann/repos","events_url":"https://api.github.com/users/tzimmermann/events{/privacy}","received_events_url":"https://api.github.com/users/tzimmermann/received_events","type":"User","site_admin":false},"labels":[{"id":584691272,"url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/labels/priority:%202%20(urgent)","name":"priority: 2 (urgent)","color":"bfdadc","default":false},{"id":584691271,"url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/labels/severity:%203%20(broken)","name":"severity: 3 (broken)","color":"BF4133","default":false},{"id":77325622,"url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/labels/type:%20Bug","name":"type: Bug","color":"FC4349","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/milestones/3","html_url":"https://github.com/webpack-contrib/extract-text-webpack-plugin/milestone/3","labels_url":"https://api.github.com/repos/webpack-contrib/extract-text-webpack-plugin/milestones/3/labels","id":2474115,"number":3,"title":"4.0.0","description":"Breaking Release (:label: Major)","creator":{"login":"michael-ciniawsky","id":5419992,"avatar_url":"https://avatars0.githubusercontent.com/u/5419992?v=4","gravatar_id":"","url":"https://api.github.com/users/michael-ciniawsky","html_url":"https://github.com/michael-ciniawsky","followers_url":"https://api.github.com/users/michael-ciniawsky/followers","following_url":"https://api.github.com/users/michael-ciniawsky/following{/other_user}","gists_url":"https://api.github.com/users/michael-ciniawsky/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-ciniawsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-ciniawsky/subscriptions","organizations_url":"https://api.github.com/users/michael-ciniawsky/orgs","repos_url":"https://api.github.com/users/michael-ciniawsky/repos","events_url":"https://api.github.com/users/michael-ciniawsky/events{/privacy}","received_events_url":"https://api.github.com/users/michael-ciniawsky/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":5,"state":"open","created_at":"2017-04-22T19:41:55Z","updated_at":"2018-02-28T10:05:14Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2018-02-26T13:38:01Z","updated_at":"2018-02-28T10:05:14Z","closed_at":"2018-02-28T10:05:14Z","author_association":"NONE","body":"I get `TypeError: Cannot read property 'moduleExports' of undefined` after upgrading to webpack 4 and the new alpha of the extract-text plugin:\r\n\r\n```\r\n\"extract-text-webpack-plugin\": \"4.0.0-alpha.0\",\r\n\"webpack\": \"4.0.0\"\r\n```\r\n\r\nThe stack trace points to `.chunkModule.source()` being called without parameter [here](https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/v4.0.0-alpha.0/src/index.js#L94), which leads to the `runtime` variable being undefined [here](https://github.com/webpack/webpack/blob/master/lib/DelegatedModule.js#L66)\r\n\r\nThis looks like the same line is causing this as in #722.\r\n\r\n**EDIT:** I can confirm that the issue is related to dynamic module loading: If I remove all dynamic import statements, the error goes away (see https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/722#issuecomment-368696250)\r\n\r\nHere's the full stack trace:\r\n```\r\n/Users/tz-mac/Repos/pex-client/node_modules/webpack/lib/DelegatedModule.js:66\r\n                        str = `module.exports = (${runtime.moduleExports({\r\n                                                          ^\r\n\r\nTypeError: Cannot read property 'moduleExports' of undefined\r\n    at DelegatedModule.source (/Users/tz-mac/Repos/pex-client/node_modules/webpack/lib/DelegatedModule.js:66:38)\r\n    at Function.renderExtractedChunk (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/dist/index.js:115:38)\r\n    at ExtractTextPlugin.extractedChunks.forEach.extractedChunk (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/dist/index.js:298:46)\r\n    at Array.forEach (<anonymous>)\r\n    at compilation.hooks.additionalAssets.tapAsync.assetCb (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/dist/index.js:286:25)\r\n    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/tz-mac/Repos/pex-client/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)\r\n    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/tz-mac/Repos/pex-client/node_modules/tapable/lib/Hook.js:35:21)\r\n    at hooks.optimizeTree.callAsync.err (/Users/tz-mac/Repos/pex-client/node_modules/webpack/lib/Compilation.js:939:32)\r\n    at _err0 (eval at create (/Users/tz-mac/Repos/pex-client/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\r\n    at _async2.default.forEach.err (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/dist/index.js:281:11)\r\n    at /Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/node_modules/async/dist/async.js:421:16\r\n    at iteratorCallback (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/node_modules/async/dist/async.js:998:13)\r\n    at /Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/node_modules/async/dist/async.js:906:16\r\n    at _async2.default.forEach.err (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/dist/index.js:259:13)\r\n    at /Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/node_modules/async/dist/async.js:421:16\r\n    at iteratorCallback (/Users/tz-mac/Repos/pex-client/node_modules/extract-text-webpack-plugin/node_modules/async/dist/async.js:998:13)\r\n```"}}
{"actor":{"display_login":"tzimmermann"}}