René's URL Explorer Experiment


Title: Runtime errors when using buildOptimizer. JIT compilation broken. · Issue #17663 · angular/angular-cli · GitHub

Open Graph Title: Runtime errors when using buildOptimizer. JIT compilation broken. · Issue #17663 · angular/angular-cli

X Title: Runtime errors when using buildOptimizer. JIT compilation broken. · Issue #17663 · angular/angular-cli

Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Is this a regression? I don't know. I would guess this is a recent thing arising from the introduction of AOT, Ivy,...

Open Graph Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Is this a regression? I don't know. I would guess this is a recent thing ar...

X Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Is this a regression? I don't know. I would guess this is a recent thin...

Opengraph URL: https://github.com/angular/angular-cli/issues/17663

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Runtime errors when using buildOptimizer. JIT compilation broken.","articleBody":"# 🐞 Bug report\r\n\r\n### Command (mark with an `x`)\r\n\u003c!-- Can you pin-point the command or commands that are effected by this bug? -->\r\n\u003c!-- ✍️edit: -->\r\n\r\n- [ ] new\r\n- [X] build\r\n- [X] serve\r\n- [ ] test\r\n- [ ] e2e\r\n- [ ] generate\r\n- [ ] add\r\n- [ ] update\r\n- [ ] lint\r\n- [ ] xi18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n\r\n### Is this a regression?\r\nI don't know. I would guess this is a recent thing arising from the introduction of AOT, Ivy, and the build optimizer.\r\n\r\n### Description\r\nWe faced an issue with an application we were developing where the legacy application had content stored in a database. This content is essentially an Angular template and could not be known at compile-time. The situations and constraints in the project led us to create dynamic components/modules on the fly. This worked beautifully in development and then failed when deployed to production. \r\n\r\nIn diagnosis, this works as long as the build optimizer is NOT enabled. Having a production build, with the optimizer, but without the buildOptimizer, enabled still works.\r\n\r\nI believe I've seen unofficially in other issues that using AOT and JIT together, but since it works with the `buildOptimizer` disabled, this feels like an issue with the optimizer.\r\n\r\n## 🔬 Minimal Reproduction\r\nHere is a [reproduction repo](https://github.com/jcgillespie/ng-dynamic-optimized-repro)\r\nOnce you've `npm install`'d, you can run the repro this way.\r\n`ng serve` \u003c-- working\r\n`ng serve --configuration=production` \u003c--working\r\n`ng serve --configuration=production-build-optimized` \u003c-- broken.\r\nThe only difference between the configurations is the `buildOptimizer` setting.\r\nYou can run all three side-by-side-by-side by adding different `--port` values.\r\n\r\nIn a working build, you'll see an additional \"Runtime Hello!\" message as well as the Angular logo. When broken, those elements will be missing and there will be a console error. \r\n\r\nIf this isn't a bug, that error message is misleading for this situation.. :) \r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\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.\u003canonymous> (main.7000374ef126bad8069c.js:1)\r\n    at Generator.next (\u003canonymous>)\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\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n\u003cpre>\u003ccode>\r\n\r\n     _                      _                 ____ _     ___\r\n    / \\   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|\r\n   / △ \\ | '_ \\ / _` | | | | |/ _` | '__|   | |   | |    | |\r\n  / ___ \\| | | | (_| | |_| | | (_| | |      | |___| |___ | |\r\n /_/   \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_|       \\____|_____|___|\r\n                |___/\r\n    \r\n\r\nAngular CLI: 9.1.4\r\nNode: 13.11.0\r\nOS: darwin x64\r\n\r\nAngular: 9.1.4\r\n... animations, 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.901.4\r\n@angular-devkit/build-angular     0.901.4\r\n@angular-devkit/build-optimizer   0.901.4\r\n@angular-devkit/build-webpack     0.901.4\r\n@angular-devkit/core              9.1.4\r\n@angular-devkit/schematics        9.1.4\r\n@ngtools/webpack                  9.1.4\r\n@schematics/angular               9.1.4\r\n@schematics/update                0.901.4\r\nrxjs                              6.5.5\r\ntypescript                        3.8.3\r\nwebpack                           4.42.0\r\n    \r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\r\n","author":{"url":"https://github.com/jcgillespie","@type":"Person","name":"jcgillespie"},"datePublished":"2020-05-07T18:50:13Z","url":"https://github.com/angular/angular-cli/issues/17663"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b8247cdb-4216-fa85-e002-030d5946a56c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC93A:3D8CBB:102345E:1559B51:6B0109B2
html-safe-nonceb4d606fe147f82f593a14c5cd697dadc5cb22db05ae9ac9c28820682ba2ee6ab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTNBOjNEOENCQjoxMDIzNDVFOjE1NTlCNTE6NkIwMTA5QjIiLCJ2aXNpdG9yX2lkIjoiNjczNTU4ODU2MjYwMDc5MDQ1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6a682769c8c8c3a5a7440134d8b5458830e80a0d8fd7025a50f0f3fce99cfcf4
hovercard-subject-tagissue:614269799
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/17663/issue_layout
twitter:imagehttps://opengraph.githubassets.com/24e3ec0be1f54bb47e3ff3ca5ce192d216c00912f3f7aef81399ad280bf41e20/angular/angular-cli/issues/17663
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/24e3ec0be1f54bb47e3ff3ca5ce192d216c00912f3f7aef81399ad280bf41e20/angular/angular-cli/issues/17663
og:image:alt🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Is this a regression? I don't know. I would guess this is a recent thing ar...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejcgillespie
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/17663#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F17663
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F17663
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/17663
Reloadhttps://github.com/angular/angular-cli/issues/17663
Reloadhttps://github.com/angular/angular-cli/issues/17663
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/17663
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/17663
Runtime errors when using buildOptimizer. JIT compilation broken.https://github.com/angular/angular-cli/issues/17663#top
freq2: mediumhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular-cli/milestone/12
https://github.com/jcgillespie
jcgillespiehttps://github.com/jcgillespie
on May 7, 2020https://github.com/angular/angular-cli/issues/17663#issue-614269799
reproduction repohttps://github.com/jcgillespie/ng-dynamic-optimized-repro
Nexthttps://github.com/angular/angular-cli/issues/17663?timeline_page=1
https://github.com/karwank
karwankhttps://github.com/karwank
on May 8, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-625913153
https://github.com/jcgillespie
jcgillespiehttps://github.com/jcgillespie
on May 8, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-625960008
@karwankhttps://github.com/karwank
alan-agius4https://github.com/alan-agius4
comp: devkit/build-optimizerhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22comp%3A%20devkit%2Fbuild-optimizer%22
on May 11, 2020https://github.com/angular/angular-cli/issues/17663#event-3321851294
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on May 11, 2020https://github.com/angular/angular-cli/issues/17663#event-3321851349
https://github.com/karwank
karwankhttps://github.com/karwank
on May 11, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-626602224
#11439https://github.com/angular/angular-cli/issues/11439
https://github.com/jcgillespie
jcgillespiehttps://github.com/jcgillespie
on May 11, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-626691075
#11439https://github.com/angular/angular-cli/issues/11439
#11439https://github.com/angular/angular-cli/issues/11439
https://github.com/karwank
karwankhttps://github.com/karwank
on May 12, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-627233679
angular/angular#23916 (comment)https://github.com/angular/angular/issues/23916#issuecomment-389214857
https://medium.com/angular-in-depth/lazy-load-components-in-angular-596357ab05d8https://medium.com/angular-in-depth/lazy-load-components-in-angular-596357ab05d8
https://github.com/LayZeeDK/ivy-dynamic-renderinghttps://github.com/LayZeeDK/ivy-dynamic-rendering
https://stackblitz.com/angular/ovpljlvlyxohttps://stackblitz.com/angular/ovpljlvlyxo
https://github.com/alan-agius4
alan-agius4https://github.com/alan-agius4
on May 28, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-635196886
angular/angular#36255https://github.com/angular/angular/issues/36255
angular/angular#37216https://github.com/angular/angular/issues/37216
@jcgillespiehttps://github.com/jcgillespie
alan-agius4https://github.com/alan-agius4
triage #1https://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22triage%20%231%22
on May 28, 2020https://github.com/angular/angular-cli/issues/17663#event-3381679070
https://github.com/maxtacco
maxtaccohttps://github.com/maxtacco
on May 28, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-635358157
@alan-agius4https://github.com/alan-agius4
@jcgillespiehttps://github.com/jcgillespie
@karwankhttps://github.com/karwank
dgp1130https://github.com/dgp1130
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
on May 28, 2020https://github.com/angular/angular-cli/issues/17663#event-3385006746
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
Backloghttps://github.com/angular/angular-cli/milestone/12
on May 28, 2020https://github.com/angular/angular-cli/issues/17663#event-3385006785
https://github.com/Nixon-Joseph
Nixon-Josephhttps://github.com/Nixon-Joseph
on Jul 17, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-660066725
@loedemanhttps://github.com/loedeman
https://github.com/dgp1130
dgp1130https://github.com/dgp1130
on Oct 8, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-705737272
@IgorMinarhttps://github.com/IgorMinar
@alxhubhttps://github.com/alxhub
dgp1130https://github.com/dgp1130
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 8, 2020https://github.com/angular/angular-cli/issues/17663#event-3856746791
dgp1130https://github.com/dgp1130
needs: discussionOn the agenda for team meeting to determine next stepshttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22needs%3A%20discussion%22
on Oct 8, 2020https://github.com/angular/angular-cli/issues/17663#event-3856747614
https://github.com/jcgillespie
jcgillespiehttps://github.com/jcgillespie
on Oct 8, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-705740864
@dgp1130https://github.com/dgp1130
https://github.com/dgp1130
dgp1130https://github.com/dgp1130
on Oct 8, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-705778184
@jcgillespiehttps://github.com/jcgillespie
#19016https://github.com/angular/angular-cli/issues/19016
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Oct 13, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-708031596
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Oct 13, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-708034045
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 13, 2020https://github.com/angular/angular-cli/issues/17663#issuecomment-726591918
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 13, 2020https://github.com/angular/angular-cli/issues/17663#event-3992288508
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/17663
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/17663
freq2: mediumhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
BacklogNo due datehttps://github.com/angular/angular-cli/milestone/12
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.