Title: Lazy loading module broken with " No module factory available for dependency type: ContextElementDependency" · Issue #6417 · angular/angular-cli · GitHub
Open Graph Title: Lazy loading module broken with " No module factory available for dependency type: ContextElementDependency" · Issue #6417 · angular/angular-cli
X Title: Lazy loading module broken with " No module factory available for dependency type: ContextElementDependency" · Issue #6417 · angular/angular-cli
Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. $ ng --version _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / △ \ | '_ \ / _` | | |...
Open Graph Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. $ ng --version _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ _...
X Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. $ ng --version _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ ...
Opengraph URL: https://github.com/angular/angular-cli/issues/6417
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lazy loading module broken with \" No module factory available for dependency type: ContextElementDependency\"","articleBody":"### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n- [ ] feature request\r\n```\r\n\r\n### Versions.\r\n\r\n```\r\n$ ng --version\r\n _ _ ____ _ ___\r\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\r\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\r\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\r\n/_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\r\n |___/\r\n@angular/cli: 1.1.0-rc.0\r\nnode: 6.10.0\r\nos: win32 x64\r\n@angular/common: 4.1.3\r\n@angular/compiler: 4.1.3\r\n@angular/core: 4.1.3\r\n@angular/forms: 4.1.3\r\n@angular/http: 4.1.3\r\n@angular/platform-browser: 4.1.3\r\n@angular/platform-browser-dynamic: 4.1.3\r\n@angular/router: 4.1.3\r\n@angular/cli: 1.1.0-rc.0\r\n@angular/compiler-cli: 4.1.3\r\n@angular/tsc-wrapped: 4.1.3\r\n```\r\n\r\n\r\n### Repro steps.\r\n\r\nInclude a lazy loaded module in `AppRoutingModule`.\r\n\r\nThis doesn't happen with a fresh `ng new \u003cproject>` set-up. When adding `\"webpack\": \"^2.5.0\"` dependency, this breaks the build.\r\n\r\n```json\r\n \"typescript\": \"~2.3.1\",\r\n \"webpack\": \"^2.5.0\",\r\n \"webpack-dev-middleware\": \"^1.10.2\",\r\n \"webpack-dev-server\": \"^2.4.5\",\r\n \"webpack-md5-hash\": \"^0.0.5\",\r\n \"webpack-merge\": \"^4.1.0\"\r\n```\r\n\r\nA repro can be found here: [dherges/ng-cli-lazy-loading-broken-6417](https://github.com/dherges/ng-cli-lazy-loading-broken-6417). The [change in package.json dependencies](https://github.com/dherges/ng-cli-lazy-loading-broken-6417/compare/working...broken) breaks the build.\r\n\r\n\r\n\r\n### The log given by the failure.\r\n\r\n```\r\nwebpack: Compiling...\r\n 40% building modules 1/2 modules 1 active ...ework\\guide\\app\\app-routing.module.tsError: No module factory available for dependency type: ContextElementDependency\r\n at Compilation.addModuleDependencies (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:206:21)\r\n at Compilation.processModuleDependencies (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:195:8)\r\n at _this.buildModule.err (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:336:13)\r\n at building.forEach.cb (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:140:27)\r\n at Array.forEach (native)\r\n at callback (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:140:13)\r\n at module.build (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:167:11)\r\n at resolveDependencies (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\ContextModule.js:133:4)\r\n at ContextModule.result.resolveDependencies (\u003cproject>\\node_modules\\@ngtools\\webpack\\src\\plugin.js:229:25)\r\n at ContextModule.build (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\ContextModule.js:103:8)\r\n at Compilation.buildModule (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:142:10)\r\n at factoryCallback (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:325:11)\r\n at \u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\ContextModuleFactory.js:96:12\r\n at \u003cproject>\\node_modules\\tapable\\lib\\Tapable.js:204:11\r\n at done.then (\u003cproject>\\node_modules\\@ngtools\\webpack\\src\\plugin.js:231:28)\r\n at process._tickCallback (internal/process/next_tick.js:103:7)\r\n 70% building modules 2/2 modules 0 active\r\n```\r\n\r\n\r\n```\r\n 14% building modules 36/48 modules 12 active ...e_modules\\rxjs\\add\\operator\\filter.js\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\li\r\nb\\Compilation.js:265\r\n if(_this.profile) {\r\n ^\r\n\r\nTypeError: Cannot read property 'profile' of null\r\n at factoryCallback (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\Compilation.js:265:13)\r\n at factory (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\NormalModuleFactory.js:253:5)\r\n at applyPluginsAsyncWaterfall (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\NormalModuleFactory.js:99:14)\r\n at \u003cproject>\\node_modules\\tapable\\lib\\Tapable.js:204:11\r\n at NormalModuleFactory.params.normalModuleFactory.plugin (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\CompatibilityPlugin.js\r\n:52:5)\r\n at NormalModuleFactory.applyPluginsAsyncWaterfall (\u003cproject>\\node_modules\\tapable\\lib\\Tapable.js:208:13)\r\n at resolver (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\NormalModuleFactory.js:74:11)\r\n at process.nextTick (\u003cproject>\\node_modules\\@angular\\cli\\node_modules\\webpack\\lib\\NormalModuleFactory.js:205:8)\r\n at _combinedTickCallback (internal/process/next_tick.js:67:7)\r\n at process._tickCallback (internal/process/next_tick.js:98:9)\r\n```\r\n\r\n\r\n\r\n### Desired functionality.\r\n\r\nLazy loading:\r\n\r\n\r\n```ts\r\nconst routes: Routes = [\r\n {\r\n path: 'content',\r\n loadChildren: './+content/content.module#ContentModule'\r\n }\r\n];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forRoot(routes)],\r\n exports: [RouterModule]\r\n})\r\nexport class AppRoutingModule { }\r\n```\r\n\r\n### Mention any other details that might be useful.\r\n\r\nThere are other related issues from the past #3793, #4246 ","author":{"url":"https://github.com/dherges","@type":"Person","name":"dherges"},"datePublished":"2017-05-23T06:07:48Z","url":"https://github.com/angular/angular-cli/issues/6417"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b21bc3de-1d0f-8909-337c-c21bdb7be990 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0EE:395430:169571B:1DCA756:6B01303F |
| html-safe-nonce | 93b9bf322a814bc03bcb26e367e7b9d4c7e8d30981921cd4597412eb553322cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEVFOjM5NTQzMDoxNjk1NzFCOjFEQ0E3NTY6NkIwMTMwM0YiLCJ2aXNpdG9yX2lkIjoiNzI1MTIwMjUwMDMzNjg4OTkxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c3627e05f714931c6713f24906e230f44c6e427bc0d72b9b32939a4717ad5b39 |
| hovercard-subject-tag | issue:230596565 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/6417/issue_layout |
| twitter:image | https://opengraph.githubassets.com/47be4d9f5230df3f1c34171b142374e82dc3f5adb9b321184badece76360aa4d/angular/angular-cli/issues/6417 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/47be4d9f5230df3f1c34171b142374e82dc3f5adb9b321184badece76360aa4d/angular/angular-cli/issues/6417 |
| og:image:alt | Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. $ ng --version _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ _... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dherges |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width