René's URL Explorer Experiment


Title: AOT - function calls are not supported with Module.forRoot · Issue #14707 · angular/angular · GitHub

Open Graph Title: AOT - function calls are not supported with Module.forRoot · Issue #14707 · angular/angular

X Title: AOT - function calls are not supported with Module.forRoot · Issue #14707 · 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/14707

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AOT - function calls are not supported with Module.forRoot ","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\r\n-->\r\n\r\n**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\nWhen AOT compiling my project, it throws the following error:\r\n`Calling function 'PanelModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function.`\r\nEvent though I have no function/lambda functions on my PanelModule file.\r\n\r\n**Expected behavior**\r\nIt should continue compilation instead of breaking with a normal Module file.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n- Have 2 Angular 2 projects\r\n  - One only exporting a Module with its components (PanelModule)\r\n  - The other one as your main project which imports it:\r\n    - Uses webpack 2.0\r\n    - Use [@ultimate/aot-loader](https://github.com/UltimateAngular/aot-loader/wiki/Usage)\r\n    - @angular/compiler-cli\r\n\r\n**app.module.ts**\r\n```typescript\r\nimport { NgModule } from \"@angular/core\";\r\nimport { APP_BASE_HREF } from \"@angular/common\";\r\nimport { BrowserModule, Title } from \"@angular/platform-browser\";\r\n\r\n// Providers\r\nimport { URL_BASE } from \"./config\";\r\nimport { CARBON_PROVIDERS } from \"angular2-carbonldp/boot\";\r\nimport { CARBON_SERVICES_PROVIDERS } from \"angular2-carbonldp/services\";\r\nimport { routing, appRoutingProviders } from \"./app.routing\";\r\n// Components\r\nimport { AppComponent } from \"./app.component\";\r\nimport { LoginView } from \"./login/login.view\";\r\n// Modules\r\nimport { PanelModule } from \"carbonldp-panel/panel.module\";\r\n\r\n@NgModule( {\r\n    imports: [\r\n        BrowserModule,\r\n        routing,\r\n        PanelModule.forRoot(),     \u003c---- This line causes the issue\r\n    ],\r\n    declarations: [\r\n        AppComponent,\r\n        LoginView\r\n    ],\r\n    providers: [\r\n        {\r\n            provide: APP_BASE_HREF,\r\n            useValue: URL_BASE\r\n        },\r\n        CARBON_PROVIDERS,\r\n        CARBON_SERVICES_PROVIDERS,\r\n        appRoutingProviders,\r\n        Title,\r\n    ],\r\n    bootstrap: [ AppComponent ],\r\n} )\r\nexport class AppModule {}\r\n```\r\n\r\n**PanelModule**\r\n```typescript\r\n// Imports \r\n@NgModule( {\r\n    imports: [\r\n        CommonModule,\r\n        RouterModule,\r\n        SemanticModule,\r\n        DirectivesModule,\r\n        FormsModule\r\n    ],\r\n    declarations: [\r\n        HeaderComponent,\r\n\t...\r\n        PaginatorComponent,\r\n    ],\r\n    exports: [\r\n        HeaderComponent,\r\n\t...\r\n        PaginatorComponent,\r\n    ],\r\n    providers: []\r\n} )\r\n\r\nexport class PanelModule {\r\n    static forRoot():ModuleWithProviders {\r\n        return {\r\n            ngModule: PanelModule,\r\n                providers: [ HeaderService, SidebarService, RouterService, MyAppsSidebarService, ErrorsAreaService ]\r\n        };\r\n    }\r\n}\r\n```\r\n\r\nWith that configuration, every time I try to AOT compile the project it returns the error mentioned above, but, as you can see, I have no lambda function in my PanelModule forRoot file.\r\nIf I comment that line (`PanelModule.forRoot(),`) it continues compilation but I need that line to work. \r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nThe AOT compilation should work because the files are AOT compliant.\r\n\r\n**Please tell us about your environment:**\r\nOS X Sierra.\r\n\r\n* **Angular version:** 2.0.X\r\n@angular@2.4.7\r\n@angular/compiler-cli@2.4.8\r\nWebpack@2.2.1\r\n\r\n* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]\r\nall\r\n \r\n* **Language:** [all | TypeScript X.X | ES6/7 | ES5]\r\nTypescript@2.1.6\r\n\r\n* **Node (for AoT issues):** `node --version` =   \r\nv6.2.0","author":{"url":"https://github.com/alvaro9210","@type":"Person","name":"alvaro9210"},"datePublished":"2017-02-24T17:04:12Z","url":"https://github.com/angular/angular/issues/14707"}

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:e4a6328b-0e30-de05-e389-bd46bd6086e8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEA66:EA09B:26CE591:33780E2:6B01A627
html-safe-nonce531eb7816a12202c32249ea27c76e6f8d5d68e2a6a85f43460f1687f163e95cd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTY2OkVBMDlCOjI2Q0U1OTE6MzM3ODBFMjo2QjAxQTYyNyIsInZpc2l0b3JfaWQiOiIzNDgwMTczNDExNDYyOTE1NjIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacebd76c99f0b0bcaed1fab99ff7f12d004b398308ead7c3f1f3d66dd7a53c041a
hovercard-subject-tagissue:210103518
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/14707/issue_layout
twitter:imagehttps://opengraph.githubassets.com/77b531614b1f99434234d9dac4fe29a9758ace27943765eaf3d49c2dda762977/angular/angular/issues/14707
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/77b531614b1f99434234d9dac4fe29a9758ace27943765eaf3d49c2dda762977/angular/angular/issues/14707
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:usernamealvaro9210
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/14707#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F14707
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%2F14707
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/14707
Reloadhttps://github.com/angular/angular/issues/14707
Reloadhttps://github.com/angular/angular/issues/14707
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests143 (143)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/14707
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/14707
AOT - function calls are not supported with Module.forRoot https://github.com/angular/angular/issues/14707#top
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: NgModulehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20NgModule%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
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/alvaro9210
alvaro9210https://github.com/alvaro9210
on Feb 24, 2017https://github.com/angular/angular/issues/14707#issue-210103518
@ultimate/aot-loaderhttps://github.com/UltimateAngular/aot-loader/wiki/Usage
@angularhttps://github.com/angular
Nexthttps://github.com/angular/angular/issues/14707?timeline_page=1
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Feb 24, 2017https://github.com/angular/angular/issues/14707#issuecomment-282346432
https://github.com/alvaro9210
alvaro9210https://github.com/alvaro9210
on Feb 24, 2017https://github.com/angular/angular/issues/14707#issuecomment-282352570
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Feb 24, 2017https://github.com/angular/angular/issues/14707#issuecomment-282353179
https://github.com/dmytro-y-dev
dmytro-y-devhttps://github.com/dmytro-y-dev
on Feb 27, 2017https://github.com/angular/angular/issues/14707#issuecomment-282651224
@DzmitryShylovichhttps://github.com/DzmitryShylovich
angular/angular-cli#3706https://github.com/angular/angular-cli/issues/3706
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Feb 27, 2017https://github.com/angular/angular/issues/14707#issuecomment-282655078
@metamakerhttps://github.com/metamaker
https://github.com/AngularClass/angular2-webpack-starterhttps://github.com/AngularClass/angular2-webpack-starter
IgorMinarhttps://github.com/IgorMinar
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
on Mar 20, 2017https://github.com/angular/angular/issues/14707#event-1007635314
https://github.com/captainkovalsky
captainkovalskyhttps://github.com/captainkovalsky
on Apr 10, 2017https://github.com/angular/angular/issues/14707#issuecomment-293000402
https://github.com/ericmackrodt
ericmackrodthttps://github.com/ericmackrodt
on Apr 11, 2017https://github.com/angular/angular/issues/14707#issuecomment-293121599
https://github.com/ericmackrodt
ericmackrodthttps://github.com/ericmackrodt
on Apr 11, 2017https://github.com/angular/angular/issues/14707#issuecomment-293181859
https://github.com/code0wl
code0wlhttps://github.com/code0wl
on Apr 25, 2017https://github.com/angular/angular/issues/14707#issuecomment-297034788
@ericmackrodthttps://github.com/ericmackrodt
https://github.com/almgwary
almgwaryhttps://github.com/almgwary
on May 7, 2017https://github.com/angular/angular/issues/14707#issuecomment-299696861
https://github.com/MohammedSiddiqui
MohammedSiddiquihttps://github.com/MohammedSiddiqui
on Jun 5, 2017https://github.com/angular/angular/issues/14707#issuecomment-306280825
@ericmackrodthttps://github.com/ericmackrodt
https://github.com/Yugloocamai
Yugloocamaihttps://github.com/Yugloocamai
on Jun 8, 2017https://github.com/angular/angular/issues/14707#issuecomment-307247544
https://github.com/ianqueue
ianqueuehttps://github.com/ianqueue
on Jun 14, 2017https://github.com/angular/angular/issues/14707#issuecomment-308518582
https://github.com/Johanneke
Johannekehttps://github.com/Johanneke
on Sep 6, 2018https://github.com/angular/angular/issues/14707#issuecomment-419012188
https://github.com/benwinding
benwindinghttps://github.com/benwinding
on Feb 20, 2019https://github.com/angular/angular/issues/14707#issuecomment-465369880
https://github.com/shprink
shprinkhttps://github.com/shprink
on Mar 13, 2019https://github.com/angular/angular/issues/14707#issuecomment-472366790
@benwindinghttps://github.com/benwinding
https://github.com/BhavinPatel04
BhavinPatel04https://github.com/BhavinPatel04
on Mar 26, 2019https://github.com/angular/angular/issues/14707#issuecomment-476766946
docshttps://angular.io/guide/singleton-services#providing-a-singleton-service
https://github.com/gbertoncelli
gbertoncellihttps://github.com/gbertoncelli
on Oct 11, 2019https://github.com/angular/angular/issues/14707#issuecomment-541075239
yjaaidihttps://github.com/yjaaidi
on Nov 18, 2019https://github.com/angular/angular/issues/14707#event-2809499209
🐞 fix AOT issue due to logic in `forRoot`https://github.com/jscutlery/convoyr/commit/2995a4e452a421b1db10441e28cd2345956b8e85
2995a4ehttps://github.com/jscutlery/convoyr/commit/2995a4e452a421b1db10441e28cd2345956b8e85
fix: 🐞 fix AOT issue due to logic in `forRoot`https://github.com/jscutlery/convoyr/commit/ffa536360126beaf0ba726f5e0b8bd275c126b3a
ffa5363https://github.com/jscutlery/convoyr/commit/ffa536360126beaf0ba726f5e0b8bd275c126b3a
edbznhttps://github.com/edbzn
on Nov 19, 2019https://github.com/angular/angular/issues/14707#event-2811100365
fix: 🐞 fix AOT issue due to logic in `forRoot`https://github.com/jscutlery/convoyr/commit/9f2a093dda9b5f42b47fefcdefa735f1582380be
9f2a093https://github.com/jscutlery/convoyr/commit/9f2a093dda9b5f42b47fefcdefa735f1582380be
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
core: NgModulehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20NgModule%22
on Mar 11, 2020https://github.com/angular/angular/issues/14707#event-3118615724
JoostKhttps://github.com/JoostK
fixed by Ivyhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22fixed%20by%20Ivy%22
on Mar 14, 2020https://github.com/angular/angular/issues/14707#event-3129924231
https://github.com/JoostK
JoostKhttps://github.com/JoostK
on Mar 14, 2020https://github.com/angular/angular/issues/14707#issuecomment-599148335
JoostKhttps://github.com/JoostK
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 14, 2020https://github.com/angular/angular/issues/14707#event-3129929614
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Apr 14, 2020https://github.com/angular/angular/issues/14707#issuecomment-613532908
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 Apr 14, 2020https://github.com/angular/angular/issues/14707#event-3231842488
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/14707
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/14707
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: NgModulehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20NgModule%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
BacklogNo due datehttps://github.com/angular/angular/milestone/82
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.