Title: Show compile-time error/warning for using `@angular/compiler` with optimized builds · Issue #19016 · angular/angular-cli · GitHub
Open Graph Title: Show compile-time error/warning for using `@angular/compiler` with optimized builds · Issue #19016 · angular/angular-cli
X Title: Show compile-time error/warning for using `@angular/compiler` with optimized builds · Issue #19016 · angular/angular-cli
Description: 🚀 Feature request Command (mark with an x) build Description Currently it is possible to have a configuration which uses AOT compilations but also JIT during runtime and attempts to run build optimizer on the results. This doesn't really...
Open Graph Description: 🚀 Feature request Command (mark with an x) build Description Currently it is possible to have a configuration which uses AOT compilations but also JIT during runtime and attempts to run build optim...
X Description: 🚀 Feature request Command (mark with an x) build Description Currently it is possible to have a configuration which uses AOT compilations but also JIT during runtime and attempts to run build optim...
Opengraph URL: https://github.com/angular/angular-cli/issues/19016
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Show compile-time error/warning for using `@angular/compiler` with optimized builds","articleBody":"# 🚀 Feature request\r\n\r\n\r\n### Command (mark with an `x`)\r\n- [X] build\r\n\r\n### Description\r\nCurrently it is possible to have a configuration which uses AOT compilations but also JIT during runtime and attempts to run build optimizer on the results. This doesn't really work and isn't supported, leading to awkward error messages, which can be confusing to users (see #17663).\r\n\r\n### Describe the solution you'd like\r\nIdeally, the CLI would detect this case and error out if an import for `@angular/compiler` is found in user code with build optimizer enabled. We should display a more precise warning/error about this case to better explain to the users why JIT + build optimizer doesn't work and what they can to do fix it.\r\n\r\n### Describe alternatives you've considered\r\nCurrently this is a runtime error with a poor message.\r\n\r\n```\r\nmain.7000374ef126bad8069c.js:1 ERROR Error: Uncaught (in promise): Error: Angular JIT compilation failed: '@angular/compiler' not loaded!\r\n - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\r\n - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\r\n - Alternatively provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.\r\nError: Angular JIT compilation failed: '@angular/compiler' not loaded!\r\n - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\r\n - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\r\n - Alternatively provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.\r\n at Ae (main.7000374ef126bad8069c.js:1)\r\n at Function.get (main.7000374ef126bad8069c.js:1)\r\n at St (main.7000374ef126bad8069c.js:1)\r\n at new Af (main.7000374ef126bad8069c.js:1)\r\n at ud (main.7000374ef126bad8069c.js:1)\r\n at dd (main.7000374ef126bad8069c.js:1)\r\n at e.md [as compileModuleAndAllComponentsAsync] (main.7000374ef126bad8069c.js:1)\r\n at e. (main.7000374ef126bad8069c.js:1)\r\n at Generator.next ()\r\n at main.7000374ef126bad8069c.js:1\r\n at T (polyfills.a8d522dff2c1a5c4b9db.js:1)\r\n at polyfills.a8d522dff2c1a5c4b9db.js:1\r\n at a (main.7000374ef126bad8069c.js:1)\r\n at l.invoke (polyfills.a8d522dff2c1a5c4b9db.js:1)\r\n at Object.onInvoke (main.7000374ef126bad8069c.js:1)\r\n at l.invoke (polyfills.a8d522dff2c1a5c4b9db.js:1)\r\n at i.run (polyfills.a8d522dff2c1a5c4b9db.js:1)\r\n at polyfills.a8d522dff2c1a5c4b9db.js:1\r\n at l.invokeTask (polyfills.a8d522dff2c1a5c4b9db.js:1)\r\n at Object.onInvokeTask (main.7000374ef126bad8069c.js:1)\r\n```","author":{"url":"https://github.com/dgp1130","@type":"Person","name":"dgp1130"},"datePublished":"2020-10-08T19:31:21Z","url":"https://github.com/angular/angular-cli/issues/19016"}
| 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:bf17dc39-57d3-5b98-f180-73c65cca4223 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B0B4:21E3E7:12195B0:17E1838:6B01167F |
| html-safe-nonce | 40efaf902910b71a90414132c32e74bf97ee8d2c850a7b15c12cdce9dacd0bc3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEI0OjIxRTNFNzoxMjE5NUIwOjE3RTE4Mzg6NkIwMTE2N0YiLCJ2aXNpdG9yX2lkIjoiNDYxOTU2MDA2OTY2NTcyNDAzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dc4c57f945525f8f65ce587fa31502ff92d113a954b0f3bc59f3b37a9da9c110 |
| hovercard-subject-tag | issue:717606633 |
| 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/19016/issue_layout |
| twitter:image | https://opengraph.githubassets.com/138356dfa2a6b758958699f5b2ab6f8324c2c2512b9b66eb5d5c37e4b02f3954/angular/angular-cli/issues/19016 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/138356dfa2a6b758958699f5b2ab6f8324c2c2512b9b66eb5d5c37e4b02f3954/angular/angular-cli/issues/19016 |
| og:image:alt | 🚀 Feature request Command (mark with an x) build Description Currently it is possible to have a configuration which uses AOT compilations but also JIT during runtime and attempts to run build optim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dgp1130 |
| 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