René's URL Explorer Experiment


Title: (bug)router/AOT Unable to use feature-modules in routing when doing AOT compilation · Issue #11075 · angular/angular · GitHub

Open Graph Title: (bug)router/AOT Unable to use feature-modules in routing when doing AOT compilation · Issue #11075 · angular/angular

X Title: (bug)router/AOT Unable to use feature-modules in routing when doing AOT compilation · Issue #11075 · angular/angular

Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...

Open Graph Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request...

X Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not su...

Opengraph URL: https://github.com/angular/angular/issues/11075

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"(bug)router/AOT Unable to use feature-modules in routing when doing AOT compilation","articleBody":"**I'm submitting a ...**  (check one with \"x\")\n\n```\n[x] bug report => search github for a similar issue or PR before submitting\n[ ] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\nWe are using Features-Modules to encapsulate things belonging together and we are using theses Features-Modules in Routing like this:\n\napp.module.ts\n\n``` ts\n@NgModule({\n  imports: [SharedModule.forRoot(),\n            BrowserModule,\n            RouterModule.forRoot(APP_ROUTES)\n  ],\n  ...\n})\nexport class AppModule {\n}\n\n```\n\napp.routes.ts:\n\n``` ts\nexport function getTasksModule() {\n  return TasksModule;\n}\n\nexport const APP_ROUTES: Routes = [\n  ...\n  {path: 'tasks', canLoad: [LoginGuard], loadChildren: getTasksModule},\n];\n```\n\nthis works fine when not doing AOT. Now when calling\n\n```\n./node_modules/.bin/ngc -p ./src\n```\n\nthe application compiles without errors, but in runtime I get the following exception when enterting the `/tasks` route:\n\n``` ts\nError: Uncaught (in promise): TypeError: r.create is not a function\n    at resolvePromise (zone.js:558)\n    at zone.js:535\n    at ZoneDelegate.invoke (zone.js:332)\n    at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.js:41)\n```\n\nafter some debugging it looks like the application get the `TasksModule` where it needs to have the `TasksModuleNgFactory`. So the exception happens in this code:\n\nrouter_config_loader.ts\n\n``` ts\n  load(parentInjector: Injector, loadChildren: LoadChildren): Observable\u003cLoadedRouterConfig> {\n    return this.loadModuleFactory(loadChildren).map(r => {\n      const ref = r.create(parentInjector);\n      return new LoadedRouterConfig(\n          flatten(ref.injector.get(ROUTES)), ref.injector, ref.componentFactoryResolver);\n    });\n  }\n```\n\nand r is TasksModule when the exeption occurs.\n\n**Expected/desired behavior**\n\nIt should be possible to use loadChildren in combination with AOT\n\n**What is the motivation / use case for changing the behavior?**\n\nCurrently it's not possible to encapsulate routing into Feature-Modules when using the AOT-compiler\n\n**Please tell us about your environment:**\n- **Angular version:** commit 2b313e49791b932634cc58cf913a8cf867671d37\n- **Browser:** [all ] \n- **Language:** [all ] \n","author":{"url":"https://github.com/choeller","@type":"Person","name":"choeller"},"datePublished":"2016-08-25T14:42:47Z","url":"https://github.com/angular/angular/issues/11075"}

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:80a14c45-5089-1c1d-c80f-168f9dfc06c9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA840:842EC:146C76F:1B47362:6B0130F3
html-safe-nonce7201419d2f9056d10c05dc118205e7038d19c245e344ef41d37e4962fe703b24
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODQwOjg0MkVDOjE0NkM3NkY6MUI0NzM2Mjo2QjAxMzBGMyIsInZpc2l0b3JfaWQiOiIzNzg1MjU3NjM0NDIxMDkyNTk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacebeaa9da42d4cac25d2202cab7cc22077480a0ac2bc3b1bf34b55fa93817a65b
hovercard-subject-tagissue:173222678
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/11075/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7d1ab04800cb8cea9250ecf393f209474096b68d626b3c6ae221e0fcd558586d/angular/angular/issues/11075
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7d1ab04800cb8cea9250ecf393f209474096b68d626b3c6ae221e0fcd558586d/angular/angular/issues/11075
og:image:altI'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechoeller
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/11075#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F11075
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%2Fissues%2F11075
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
Reloadhttps://github.com/angular/angular/issues/11075
Reloadhttps://github.com/angular/angular/issues/11075
Reloadhttps://github.com/angular/angular/issues/11075
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/11075
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/11075
#13909https://github.com/angular/angular/pull/13909
(bug)router/AOT Unable to use feature-modules in routing when doing AOT compilationhttps://github.com/angular/angular/issues/11075#top
#13909https://github.com/angular/angular/pull/13909
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
https://github.com/choeller
choellerhttps://github.com/choeller
on Aug 25, 2016https://github.com/angular/angular/issues/11075#issue-173222678
2b313e4https://github.com/angular/angular/commit/2b313e49791b932634cc58cf913a8cf867671d37
Nexthttps://github.com/angular/angular/issues/11075?timeline_page=1
choellerhttps://github.com/choeller
on Aug 25, 2016https://github.com/angular/angular/issues/11075#event-767544539
vicbhttps://github.com/vicb
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
offline_compilehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22offline_compile%22
on Aug 30, 2016https://github.com/angular/angular/issues/11075#event-771512919
https://github.com/qdouble
qdoublehttps://github.com/qdouble
on Sep 2, 2016https://github.com/angular/angular/issues/11075#issuecomment-244333108
https://github.com/hansl
hanslhttps://github.com/hansl
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245050763
#11387https://github.com/angular/angular/pull/11387
https://github.com/choeller
choellerhttps://github.com/choeller
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245053456
https://github.com/qdouble
qdoublehttps://github.com/qdouble
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245082038
@hanslhttps://github.com/hansl
https://github.com/hansl
hanslhttps://github.com/hansl
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245103406
@choellerhttps://github.com/choeller
@qdoublehttps://github.com/qdouble
fix(lazy-loading): fix an issue with webpack and lazy loader. #11387https://github.com/angular/angular/pull/11387
https://github.com/qdouble
qdoublehttps://github.com/qdouble
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245112939
@hanslhttps://github.com/hansl
https://github.com/hansl
hanslhttps://github.com/hansl
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245115861
https://github.com/qdouble
qdoublehttps://github.com/qdouble
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245118449
@hanslhttps://github.com/hansl
https://github.com/qdouble
qdoublehttps://github.com/qdouble
on Sep 6, 2016https://github.com/angular/angular/issues/11075#issuecomment-245132790
@hanslhttps://github.com/hansl
https://github.com/hansl
hanslhttps://github.com/hansl
on Sep 7, 2016https://github.com/angular/angular/issues/11075#issuecomment-245134972
https://github.com/qdouble
qdoublehttps://github.com/qdouble
on Sep 7, 2016https://github.com/angular/angular/issues/11075#issuecomment-245135571
@hanslhttps://github.com/hansl
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Jan 11, 2017https://github.com/angular/angular/issues/11075#issuecomment-271959270
@SamVerschuerenhttps://github.com/SamVerschueren
https://github.com/SamVerschueren
SamVerschuerenhttps://github.com/SamVerschueren
on Jan 11, 2017https://github.com/angular/angular/issues/11075#issuecomment-271960389
@DzmitryShylovichhttps://github.com/DzmitryShylovich
app.routing.tshttps://github.com/SamVerschueren/ng2-hello-world-routing/blob/load-children/app/app.routing.ts
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Jan 11, 2017https://github.com/angular/angular/issues/11075#issuecomment-271970496
https://github.com/kpudlik
kpudlikhttps://github.com/kpudlik
on Jan 13, 2017https://github.com/angular/angular/issues/11075#issuecomment-272347956
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Jan 13, 2017https://github.com/angular/angular/issues/11075#issuecomment-272384125
#13909https://github.com/angular/angular/pull/13909
mheveryhttps://github.com/mhevery
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#13909https://github.com/angular/angular/pull/13909
on Jan 18, 2017https://github.com/angular/angular/issues/11075#event-928355435
mheveryhttps://github.com/mhevery
on Jan 18, 2017https://github.com/angular/angular/issues/11075#event-928355679
fix(router): enable loadChildren with function in aot (#13909)https://github.com/angular/angular/commit/635bf02b02973c62fb0180e64732fe601d350a45
#13909https://github.com/angular/angular/pull/13909
https://docs.github.com/articles/closing-issues-via-commit-messages
635bf02https://github.com/angular/angular/commit/635bf02b02973c62fb0180e64732fe601d350a45
fix(router): enable loadChildren with function in aot (#13909)https://github.com/angular/angular/commit/2af58622c1789673a527125e059af4c553598a26
#13909https://github.com/angular/angular/pull/13909
https://docs.github.com/articles/closing-issues-via-commit-messages
2af5862https://github.com/angular/angular/commit/2af58622c1789673a527125e059af4c553598a26
wKozahttps://github.com/wKoza
on Feb 12, 2017https://github.com/angular/angular/issues/11075#event-958611107
fix(router): enable loadChildren with function in aot (angular#13909)https://github.com/wKoza/angular/commit/fac2a075c9ad75a021adbfe7d06fefa823a710d3
angular#13909https://github.com/angular/angular/pull/13909
https://docs.github.com/articles/closing-issues-via-commit-messages
fac2a07https://github.com/wKoza/angular/commit/fac2a075c9ad75a021adbfe7d06fefa823a710d3
https://github.com/baisui1981
baisui1981https://github.com/baisui1981
on Aug 12, 2017https://github.com/angular/angular/issues/11075#issuecomment-321963438
@SamVerschuerenhttps://github.com/SamVerschueren
juleskremerhttps://github.com/juleskremer
on Aug 28, 2017https://github.com/angular/angular/issues/11075#event-1224652024
fix(router): enable loadChildren with function in aot (angular#13909)https://github.com/juleskremer/angular/commit/ebc9b587938d139d7958af6e9a951ebcf902580f
angular#13909https://github.com/angular/angular/pull/13909
https://docs.github.com/articles/closing-issues-via-commit-messages
ebc9b58https://github.com/juleskremer/angular/commit/ebc9b587938d139d7958af6e9a951ebcf902580f
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 12, 2019https://github.com/angular/angular/issues/11075#issuecomment-530683525
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 12, 2019https://github.com/angular/angular/issues/11075#event-2627986478
idlecharahttps://github.com/idlechara
on Apr 27, 2021https://github.com/angular/angular/issues/11075#event-4648387897
fix(router): enable loadChildren with function in aot (angular#13909)https://github.com/idlechara/angular/commit/d622a787641288dab1d7bfa54be992d39290fa20
angular#13909https://github.com/angular/angular/pull/13909
https://docs.github.com/articles/closing-issues-via-commit-messages
d622a78https://github.com/idlechara/angular/commit/d622a787641288dab1d7bfa54be992d39290fa20
adhambaouzhttps://github.com/adhambaouz
on Nov 20, 2026https://github.com/angular/angular/issues/11075#event-36821992476
fix(router): enable loadChildren with function in aot (angular#13909)https://github.com/adhambaouz/angular/commit/03c6f2482b3cca220ba65e133992e5ee7fd8ce87
angular#13909https://github.com/angular/angular/pull/13909
https://docs.github.com/articles/closing-issues-via-commit-messages
03c6f24https://github.com/adhambaouz/angular/commit/03c6f2482b3cca220ba65e133992e5ee7fd8ce87
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/11075
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/11075
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
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.