René's URL Explorer Experiment


Title: Dynamic standalone component can not resolve FormsModule (probably others from @angular/*) · Issue #48034 · angular/angular · GitHub

Open Graph Title: Dynamic standalone component can not resolve FormsModule (probably others from @angular/*) · Issue #48034 · angular/angular

X Title: Dynamic standalone component can not resolve FormsModule (probably others from @angular/*) · Issue #48034 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? No Description I have a standalone component defined like this: import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms...

Open Graph Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? No Description I have a standalone component defined like this: import { CommonModule } from '@angular/common'; imp...

X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? No Description I have a standalone component defined like this: import { CommonModule } from '@angular/common&#...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dynamic standalone component can not resolve FormsModule (probably others from @angular/*)","articleBody":"### Which @angular/* package(s) are the source of the bug?\r\n\r\ncore\r\n\r\n### Is this a regression?\r\n\r\nNo\r\n\r\n### Description\r\n\r\nI have a standalone component defined like this: \r\n```TS\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\n\r\nexport const componentMetadata : Component = {\r\n\tjit: true,\r\n\tstandalone: true,\r\n\tselector: '\u003cdynamic-component>',\r\n\timports: [\r\n\t\tFormsModule, CommonModule\r\n\t],\r\n};\r\nexport class DynamicComponent {\r\n\t\r\n\tpublic constructor() {}\r\n....\r\n}\r\n```\r\nThen I have component that should create dynamically, as a child, this component, with template that is coming from DB.\r\nSample code:\r\n```TS\r\nimport ....\r\n\r\n@Component({\r\n\tstandalone: true,\r\n\tselector: '\u003ccontainer-component>',\r\n\ttemplate: '\u003cng-container #content>\u003c/ng-container>',\r\n\tproviders: [ {\r\n\t\tprovide: NG_VALUE_ACCESSOR,\r\n\t\tuseExisting: forwardRef(() => ContainerComponent),\r\n\t\tmulti: true\r\n\t}],\r\n})\r\n\r\nexport class ContainerComponent implements OnInit, OnDestroy, ControlValueAccessor {\r\n.....\r\n    @ViewChild('content', { read: ViewContainerRef, static: true })\r\n    contentContainer: ViewContainerRef;\r\n.....\r\n    private async createContent() {\r\n\tthis.cleanComponentRef();\r\n\tconst component = await this.setupContentComponent(this.content); // we have content when we reach this method\r\n\tthis.componentRef = this.contentContainer.createComponent(component, {\r\n\t\tinjector: this.contentContainer.injector,\r\n\t});\r\n    }\r\n\r\n    private async setupContentComponent(content: string = '') {\r\n\tconst defs = await import('./dynamic.component');\r\n\tconst currentMeta = { ...defs.componentMetadata };\r\n\tcurrentMeta.template = content;\r\n\r\n\treturn Component(currentMeta)(defs.DynamicComponent);\r\n    }\r\n\r\n    private cleanComponentRef() {\r\n\tif (this.componentRef) {\r\n\t    this.componentRef.destroy();\r\n\t    delete this.componentRef;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nThe content is angular template with directives like `ngModel`.\r\nThe problem is that i get a lot of `Can't bind to 'ngModel' since it isn't a known property of....`, but Forms module is imported in the dynamic component and should be compiled properly (IMO)\r\n\r\nDuring investigation I reached a function in core.mjs  `function getStandaloneDefFunctions(type, imports) {`\r\nwhen checking for exported directives in this code:\r\n\r\n```TS\r\nif (!!getNgModuleDef(dep)) {\r\n  const scope = transitiveScopesFor(dep);\r\n  for (const dir of scope.exported.directives) {\r\n```\r\ndep (FormsModule) doesn't have any exported members\r\n\r\nscope {\r\n    \"schemas\": null,\r\n    \"compilation\": {\r\n        \"directives\": {},\r\n        \"pipes\": {}\r\n    },\r\n    \"exported\": {\r\n        \"directives\": {},\r\n        \"pipes\": {}\r\n    }\r\n}\r\n\r\n\r\n### Please provide a link to a minimal reproduction of the bug\r\n\r\n[StackBlitz](https://stackblitz.com/edit/angular-ivy-ayuth7?file=src/app/app.component.html)\r\n\r\n### Please provide the exception or error you saw\r\n\r\n```true\r\nNG0303: Can't bind to 'ngModel' since it isn't a known property of\r\n```\r\n\r\n\r\n### Please provide the environment you discovered this bug in (run `ng version`)\r\n\r\n```true\r\nAngular CLI: 14.2.9\r\nNode: 19.0.1 (Unsupported)\r\nPackage Manager: npm 8.19.2 \r\nOS: linux x64\r\n\r\nAngular: 14.2.10\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... localize, platform-browser, platform-browser-dynamic, router\r\n\r\nPackage                         Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect       0.1402.9\r\n@angular-devkit/build-angular   14.2.9\r\n@angular-devkit/core            14.2.9\r\n@angular-devkit/schematics      14.2.9\r\n@angular/cdk                    14.2.7\r\n@angular/cli                    14.2.9\r\n@schematics/angular             14.2.9\r\nrxjs                            7.5.7\r\ntypescript                      4.7.4\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\nThis is happening when `aot: true` in angular.json\r\nWhen `aot: false`, then all is working but then template translations (all tags in .html files having `i18n` attribute) are not expanded, but all `@localize'text'` messages are. Probably this is for another issue / discussion","author":{"url":"https://github.com/ghost81","@type":"Person","name":"ghost81"},"datePublished":"2022-11-11T17:59:53Z","url":"https://github.com/angular/angular/issues/48034"}

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:495807d5-10dc-9d67-7e77-030814411e05
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE0C:B53AF:1076A29:15EF71D:6B011404
html-safe-nonce1f828bc796346a7e570dfded38b65822613b72e4fbf21250563a03a9d46af654
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTBDOkI1M0FGOjEwNzZBMjk6MTVFRjcxRDo2QjAxMTQwNCIsInZpc2l0b3JfaWQiOiIzNjI1NzYxNDI5NzIzODc4NDA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6cfc8f0642a9f789351455b4dc888745ba282e0c1f8eb7cef6f3316315e038b0
hovercard-subject-tagissue:1445825210
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/48034/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f3d145c9ca9da60340e7495a25669f0e4d8ad9a50da144ec36191319709e1c85/angular/angular/issues/48034
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f3d145c9ca9da60340e7495a25669f0e4d8ad9a50da144ec36191319709e1c85/angular/angular/issues/48034
og:image:altWhich @angular/* package(s) are the source of the bug? core Is this a regression? No Description I have a standalone component defined like this: import { CommonModule } from '@angular/common'; imp...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameghost81
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
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
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/48034#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F48034
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%2F48034
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/48034
Reloadhttps://github.com/angular/angular/issues/48034
Reloadhttps://github.com/angular/angular/issues/48034
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)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/48034
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/48034
Dynamic standalone component can not resolve FormsModule (probably others from @angular/*)https://github.com/angular/angular/issues/48034#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
needs reproductionThis issue needs a reproduction in order for the team to investigate furtherhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22needs%20reproduction%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 11, 2022https://github.com/angular/angular/issues/48034#issue-1445825210
StackBlitzhttps://stackblitz.com/edit/angular-ivy-ayuth7?file=src/app/app.component.html
https://github.com/JoostK
JoostKhttps://github.com/JoostK
on Nov 11, 2022https://github.com/angular/angular/issues/48034#issuecomment-1312025980
JoostKhttps://github.com/JoostK
needs reproductionThis issue needs a reproduction in order for the team to investigate furtherhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22needs%20reproduction%22
on Nov 11, 2022https://github.com/angular/angular/issues/48034#event-7794154608
jessicajaniukhttps://github.com/jessicajaniuk
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Nov 11, 2022https://github.com/angular/angular/issues/48034#event-7794561393
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular/milestone/82
on Nov 11, 2022https://github.com/angular/angular/issues/48034#event-7794561855
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 11, 2022https://github.com/angular/angular/issues/48034#issuecomment-1312132867
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 11, 2022https://github.com/angular/angular/issues/48034#issuecomment-1312209049
StackBlitzhttps://stackblitz.com/edit/angular-ivy-ayuth7?file=src/app/app.component.html
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Nov 12, 2022https://github.com/angular/angular/issues/48034#issuecomment-1312460291
a testhttps://github.com/JeanMeche/angular-change-detection/tree/broken-standalone
https://github.com/JoostK
JoostKhttps://github.com/JoostK
on Nov 13, 2022https://github.com/angular/angular/issues/48034#issuecomment-1312816431
a testhttps://github.com/JeanMeche/angular-change-detection/tree/broken-standalone
#47996https://github.com/angular/angular/issues/47996
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Nov 14, 2022https://github.com/angular/angular/issues/48034#issuecomment-1313742576
this filehttps://github.com/JeanMeche/angular-change-detection/blob/broken-standalone/src/app/app.component.ts
https://github.com/JoostK
JoostKhttps://github.com/JoostK
on Nov 14, 2022https://github.com/angular/angular/issues/48034#issuecomment-1313748106
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Nov 14, 2022https://github.com/angular/angular/issues/48034#issuecomment-1313769276
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 14, 2022https://github.com/angular/angular/issues/48034#issuecomment-1313935247
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Nov 15, 2022https://github.com/angular/angular/issues/48034#issuecomment-1315587584
@ghost81https://github.com/ghost81
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 15, 2022https://github.com/angular/angular/issues/48034#issuecomment-1315632476
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Nov 15, 2022https://github.com/angular/angular/issues/48034#issuecomment-1315703969
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 15, 2022https://github.com/angular/angular/issues/48034#issuecomment-1315831021
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 15, 2022https://github.com/angular/angular/issues/48034#issuecomment-1315832470
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 18, 2022https://github.com/angular/angular/issues/48034#issuecomment-1320177097
44660https://github.com/angular/angular/issues/44660
22570https://github.com/angular/angular-cli/issues/22570
ghost81https://github.com/ghost81
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 18, 2022https://github.com/angular/angular/issues/48034#event-7844928831
https://github.com/ghost81
ghost81https://github.com/ghost81
on Nov 22, 2022https://github.com/angular/angular/issues/48034#issuecomment-1323516603
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Dec 23, 2022https://github.com/angular/angular/issues/48034#issuecomment-1364073482
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 Dec 23, 2022https://github.com/angular/angular/issues/48034#event-8104264812
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/48034
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/48034
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
needs reproductionThis issue needs a reproduction in order for the team to investigate furtherhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22needs%20reproduction%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.