Title: When built with optimization compileModuleAndAllComponentsSync returns an empty list of component factories · Issue #36255 · angular/angular · GitHub
Open Graph Title: When built with optimization compileModuleAndAllComponentsSync returns an empty list of component factories · Issue #36255 · angular/angular
X Title: When built with optimization compileModuleAndAllComponentsSync returns an empty list of component factories · Issue #36255 · angular/angular
Description: 🐞 bug report Affected Package @angular/compiler Is this a regression? This seems to be the behavoir since at least 9.0.1. Description Calling the Compiler.compileModuleAndAllComponentsSync method is supposed to return the component facto...
Open Graph Description: 🐞 bug report Affected Package @angular/compiler Is this a regression? This seems to be the behavoir since at least 9.0.1. Description Calling the Compiler.compileModuleAndAllComponentsSync method i...
X Description: 🐞 bug report Affected Package @angular/compiler Is this a regression? This seems to be the behavoir since at least 9.0.1. Description Calling the Compiler.compileModuleAndAllComponentsSync method i...
Opengraph URL: https://github.com/angular/angular/issues/36255
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"When built with optimization compileModuleAndAllComponentsSync returns an empty list of component factories","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n\r\n@angular/compiler\r\n\r\n### Is this a regression?\r\n\r\nThis seems to be the behavoir since at least 9.0.1.\r\n\r\n### Description\r\n\r\nCalling the `Compiler.compileModuleAndAllComponentsSync` method is supposed to return the component factories in addition to the module factory. However, when built with --prod, that list is empty.\r\n\r\nLooking over the compiled code, it looks like the `declarations` are completely removed from the module. Setting 'optimization' to false in angular.json solves the problem, but that means the code is no longer built for production.\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\nThe problem can be observed with this minimal repo: https://github.com/AndreiVajnaII/lazy-load-ng-modules\r\n\r\nJust `npm install` and `ng serve`. Clicking on either \"Load module 1\" or \"Load module 2\" will call the \r\n`compileModuleAndAllComponentsSync` on a lazy loaded module and display a list of components it declares. However, if started with `ng serve --prod`, the list will be empty.\r\n\r\n## 🔥 Exception or Error\r\nNo error is given, the list of component factories is just empty\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 9.0.7\r\nNode: 10.14.1\r\nOS: win32 x64\r\n\r\nAngular: 9.0.7\r\n... cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.900.7\r\n@angular-devkit/build-angular 0.900.7\r\n@angular-devkit/build-optimizer 0.900.7\r\n@angular-devkit/build-webpack 0.900.7\r\n@angular-devkit/core 9.0.7\r\n@angular-devkit/schematics 9.0.7\r\n@ngtools/webpack 9.0.7\r\n@schematics/angular 9.0.7\r\n@schematics/update 0.900.7\r\nrxjs 6.5.4\r\ntypescript 3.7.5\r\nwebpack 4.41.2\r\n\u003c/code>\u003c/pre>\r\n\r\n","author":{"url":"https://github.com/AndreiVajnaII","@type":"Person","name":"AndreiVajnaII"},"datePublished":"2020-03-26T08:04:57Z","url":"https://github.com/angular/angular/issues/36255"}
| 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:aae7909f-6db3-7df9-e4b6-c596e3b80f3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E98C:27E5CD:10A2650:157085D:6B010737 |
| html-safe-nonce | 12f4c03abda4ce5ead1d34376eba79afae46d1114ef8cb63ac666d3aea9c3405 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOThDOjI3RTVDRDoxMEEyNjUwOjE1NzA4NUQ6NkIwMTA3MzciLCJ2aXNpdG9yX2lkIjoiNzE1MjEwOTIxMjQ1MjA2MzAzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 13e4dfe7060e8465522ca8e4193596c9fc4738e3438cb2275539ef0d6ef0cec9 |
| hovercard-subject-tag | issue:588228960 |
| 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/36255/issue_layout |
| twitter:image | https://opengraph.githubassets.com/02269bbdaa20141c0860fd5e66ca94488bd017d0df6788b5b99bb269a50f5d34/angular/angular/issues/36255 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/02269bbdaa20141c0860fd5e66ca94488bd017d0df6788b5b99bb269a50f5d34/angular/angular/issues/36255 |
| og:image:alt | 🐞 bug report Affected Package @angular/compiler Is this a regression? This seems to be the behavoir since at least 9.0.1. Description Calling the Compiler.compileModuleAndAllComponentsSync method i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AndreiVajnaII |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width