Title: [Bug] cli needs to be reloaded when a lazy loaded module is added in routes (FIXED) · Issue #9825 · angular/angular-cli · GitHub
Open Graph Title: [Bug] cli needs to be reloaded when a lazy loaded module is added in routes (FIXED) · Issue #9825 · angular/angular-cli
X Title: [Bug] cli needs to be reloaded when a lazy loaded module is added in routes (FIXED) · Issue #9825 · angular/angular-cli
Description: Versions Angular CLI: 1.7.1 Node: 8.9.4 OS: win32 x64 Angular: 5.2.6 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router @angular/cli: 1.7.1 @angul...
Open Graph Description: Versions Angular CLI: 1.7.1 Node: 8.9.4 OS: win32 x64 Angular: 5.2.6 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dy...
X Description: Versions Angular CLI: 1.7.1 Node: 8.9.4 OS: win32 x64 Angular: 5.2.6 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dy...
Opengraph URL: https://github.com/angular/angular-cli/issues/9825
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug] cli needs to be reloaded when a lazy loaded module is added in routes (FIXED)","articleBody":"\u003c!--\r\nWe will close this issue if you don't provide the needed information.\r\nFor feature requests, delete the form below and describe the requirements and use case.\r\n-->\r\n\r\n### Versions\r\n```\r\nAngular CLI: 1.7.1\r\nNode: 8.9.4\r\nOS: win32 x64\r\nAngular: 5.2.6\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\n@angular/cli: 1.7.1\r\n@angular-devkit/build-optimizer: 0.3.2\r\n@angular-devkit/core: 0.3.2\r\n@angular-devkit/schematics: 0.3.2\r\n@ngtools/json-schema: 1.2.0\r\n@ngtools/webpack: 1.10.1\r\n@schematics/angular: 0.3.2\r\n@schematics/package-update: 0.3.2\r\ntypescript: 2.5.3\r\nwebpack: 3.11.0\r\n```\r\n\r\n### Repro steps\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\n\r\n* Run `ng serve` to start the application bundle\r\n* Create a new lazy module\r\n* Modify the routes in the main module to do lazy load of the new module\r\n\r\n### Observed behavior\r\n\r\nThe lazy module cannot be loaded.\r\n\r\n\u003cdetails>\r\n \u003csummary>Stack\u003c/summary>\r\n\r\n```\r\nnull: ERROR\r\nnull: Error: Uncaught (in promise): TypeError: __webpack_require__.e is not a function\r\nmessage: \"Uncaught (in promise): TypeError: __webpack_require__.e is not a function\r\nTypeError: __webpack_require__.e is not a function\r\n at webpackAsyncContext (eval at ./src/$$_lazy_route_resource lazy recursive (http://localhost:4200/main.bundle.js:13:1), \u003canonymous>:11:29)\r\n at SystemJsNgModuleLoader.loadAndCompile (webpack-internal:///./node_modules/@angular/core/esm5/core.js:6774:82)\r\n at SystemJsNgModuleLoader.load (webpack-internal:///./node_modules/@angular/core/esm5/core.js:6758:60)\r\n at RouterConfigLoader.loadModuleFactory (webpack-internal:///./node_modules/@angular/router/esm5/router.js:4626:122)\r\n at RouterConfigLoader.load (webpack-internal:///./node_modules/@angular/router/esm5/router.js:4606:52)\r\n at MergeMapSubscriber.eval [as project] (webpack-internal:///./node_modules/@angular/router/esm5/router.js:2098:115)\r\n at MergeMapSubscriber._tryNext (webpack-internal:///./node_modules/rxjs/_esm5/operators/mergeMap.js:133:27)\r\n at MergeMapSubscriber._next (webpack-internal:///./node_modules/rxjs/_esm5/operators/mergeMap.js:123:18)\r\n at MergeMapSubscriber.Subscriber.next (webpack-internal:///./node_modules/rxjs/_esm5/Subscriber.js:97:18)\r\n at ScalarObservable._subscribe (webpack-internal:///./node_modules/rxjs/_esm5/observable/ScalarObservable.js:53:24)\"\r\npromise: ZoneAwarePromise {__zone_symbol__state: 0, __zone_symbol__value: TypeError: __webpack_require__.e is not a function…}\r\nrejection: TypeError: __webpack_require__.e is not a function\r\nstack: \"Error: Uncaught (in promise): TypeError: __webpack_require__.e is not a function\r\nTypeError: __webpack_require__.e is not a function\r\n at webpackAsyncContext (eval at ./src/$$_lazy_route_resource lazy recursive (http://localhost:4200/main.bundle.js:13:1), \u003canonymous>:11:29)\r\n at SystemJsNgModuleLoader.loadAndCompile (webpack-internal:///./node_modules/@angular/core/esm5/core.js:6774:82)\r\n at SystemJsNgModuleLoader.load (webpack-internal:///./node_modules/@angular/core/esm5/core.js:6758:60)\r\n at RouterConfigLoader.loadModuleFactory (webpack-internal:///./node_modules/@angular/router/esm5/router.js:4626:122)\r\n at RouterConfigLoader.load (webpack-internal:///./node_modules/@angular/router/esm5/router.js:4606:52)\r\n at MergeMapSubscriber.eval [as project] (webpack-internal:///./node_modules/@angular/router/esm5/router.js:2098:115)\r\n at MergeMapSubscriber._tryNext (webpack-internal:///./node_modules/rxjs/_esm5/operators/mergeMap.js:133:27)\r\n at MergeMapSubscriber._next (webpack-internal:///./node_modules/rxjs/_esm5/operators/mergeMap.js:123:18)\r\n at MergeMapSubscriber.Subscriber.next (webpack-internal:///./node_modules/rxjs/_esm5/Subscriber.js:97:18)\r\n at ScalarObservable._subscribe (webpack-internal:///./node_modules/rxjs/_esm5/observable/ScalarObservable.js:53:24)\r\n at resolvePromise (webpack-internal:///./node_modules/zone.js/dist/zone.js:809:31)\r\n at resolvePromise (webpack-internal:///./node_modules/zone.js/dist/zone.js:775:17)\r\n at eval (webpack-internal:///./node_modules/zone.js/dist/zone.js:858:17)\r\n at ZoneDelegate.invokeTask (webpack-internal:///./node_modules/zone.js/dist/zone.js:421:31)\r\n at Object.onInvokeTask (webpack-internal:///./node_modules/@angular/core/esm5/core.js:4956:33)\r\n at ZoneDelegate.invokeTask (webpack-internal:///./node_modules/zone.js/dist/zone.js:420:36)\r\n at Zone.runTask (webpack-internal:///./node_modules/zone.js/dist/zone.js:188:47)\r\n at drainMicroTaskQueue (webpack-internal:///./node_modules/zone.js/dist/zone.js:595:35)\r\n at \u003canonymous>\"\r\ntask: ZoneTask {_zone: Zone, runCount: 0, _zoneDelegates: null, …}\r\nzone: Zone {_properties: Object, _parent: Zone, _name: \"angular\", …}\r\n__proto__: Object {constructor: , name: \"Error\", message: \"\", …}\r\n```\r\n\u003c/details>\r\n\r\n### Desired behavior\r\n\u003c!--\r\nWhat would like to see implemented?\r\nWhat is the usecase?\r\nWhat did you expect to see?\r\n-->\r\n\r\nThe module should load without errors.\r\n\r\n### Mention any other details that might be useful (optional)\r\n\r\nThe real problem here, is that the cli does not catch up the module after the path is changed. \r\n\r\n# Current workarounds:\r\n- Just *reloading the cli* makes the lazy loaded module to work again.\r\n\r\nI haven't try every recommended workaround, but some of them are clearly not a option if you really want those modules to be lazy loaded. This is especially true for solutions like: \r\n\r\n```ts\r\nimport { LazyModule } from 'lazy-module';\r\n```\r\n\r\nAnything that makes the module to be bundle with the app, is not an acceptable workaround. \r\n\r\nIf you are having issues with a lazy loaded module, that is *NOT* about changing the route o creating another lazy loaded module into the path when the *CLI is serving*, then you should look a proper issue, or create a new one. \r\n","author":{"url":"https://github.com/michaeljota","@type":"Person","name":"michaeljota"},"datePublished":"2018-02-28T21:57:17Z","url":"https://github.com/angular/angular-cli/issues/9825"}
| 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:c2c3d378-2e09-7efe-dddf-a88d760451e3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B264:10DACD:12F15DA:1927EBA:6B01200E |
| html-safe-nonce | 2e014e6ccaca8bb193168dd642385eece72149b83045a584a272c0bb97fa22d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjY0OjEwREFDRDoxMkYxNURBOjE5MjdFQkE6NkIwMTIwMEUiLCJ2aXNpdG9yX2lkIjoiMjU5NzU3MzA4OTcyMjE3OTU5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 266e843565b73286382be331471a0f4605d90a2a59e17fd03876c2e69a489b65 |
| hovercard-subject-tag | issue:301198797 |
| 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/9825/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04e402dc0b1bbc21ada136c6ced58737998e55b63fc1ca5957213709e0c6d3ed/angular/angular-cli/issues/9825 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04e402dc0b1bbc21ada136c6ced58737998e55b63fc1ca5957213709e0c6d3ed/angular/angular-cli/issues/9825 |
| og:image:alt | Versions Angular CLI: 1.7.1 Node: 8.9.4 OS: win32 x64 Angular: 5.2.6 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dy... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | michaeljota |
| 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