René's URL Explorer Experiment


Title: Unclear error message for badly configured custom form controls · Issue #44486 · angular/angular · GitHub

Open Graph Title: Unclear error message for badly configured custom form controls · Issue #44486 · angular/angular

X Title: Unclear error message for badly configured custom form controls · Issue #44486 · angular/angular

Description: Which @angular/* package(s) are relevant/releated to the feature request? forms Description I was hitting the following error when implementing a custom form control: ERROR Error: Value accessor was not provided as an array for form cont...

Open Graph Description: Which @angular/* package(s) are relevant/releated to the feature request? forms Description I was hitting the following error when implementing a custom form control: ERROR Error: Value accessor wa...

X Description: Which @angular/* package(s) are relevant/releated to the feature request? forms Description I was hitting the following error when implementing a custom form control: ERROR Error: Value accessor wa...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unclear error message for badly configured custom form controls","articleBody":"### Which @angular/* package(s) are relevant/releated to the feature request?\r\n\r\nforms\r\n\r\n### Description\r\n\r\nI was hitting the following error when implementing a custom form control:\r\n\r\n```\r\nERROR Error: Value accessor was not provided as an array for form control with unspecified name attribute\r\n    at _throwError (forms.mjs:1752)\r\n    at selectValueAccessor (forms.mjs:1782)\r\n    at new FormControlName (forms.mjs:5743)\r\n    at NodeInjectorFactory.FormControlName_Factory [as factory] (forms.mjs:5827)\r\n    at getNodeInjectable (core.mjs:3556)\r\n    at searchTokensOnInjector (core.mjs:3493)\r\n    at getOrCreateInjectable (core.mjs:3437)\r\n    at ɵɵdirectiveInject (core.mjs:14720)\r\n    at ɵɵinject (core.mjs:4778)\r\n    at NodeInjectorFactory.factory (core.mjs:11563)\r\n```\r\n\r\nIt was very unclear to me what this error message meant or how to fix it. My form controls all had names and formControlNames.\r\n\r\nOnly by uncommenting parts of my form could I even find the offending form control, since the error doesn’t specify what it was trying to do when the error occured.\r\n\r\nGoogling the error only brought up the [source code for the test](https://github.com/angular/angular/blob/master/packages/forms/test/directives_spec.ts#L53) regarding this error, but there’s no explanation _why_ an error is thrown there, either.\r\n\r\nThe actual error was that my form control was badly configured, i.e. it provided the NG_VALUE_ACCESSOR like this:\r\n\r\n```\r\n  providers: [\r\n    { provide: NG_VALUE_ACCESSOR, useExisting: MyControl},\r\n  ]\r\n```\r\ninstead of this\r\n```\r\n  providers: [\r\n    { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MyControl), multi: true },\r\n  ]\r\n```\r\n\r\nMaybe related? Maybe related: https://github.com/angular/angular/issues/3011\r\n\r\nHere’s a reproduction: https://stackblitz.com/edit/angular-ivy-e2wj4z?file=src/app/app.component.ts\r\n\r\n### Proposed solution\r\n\r\nSince I still don’t know the actual cause of the error, I can’t propose a solution to a clearer error message. It would be nice to know the class or form control *something* was trying to process when the error happens.\r\n\r\nAndrew Kushnir [proposed a solution](https://github.com/angular/angular/issues/44486#issuecomment-996307788):\r\n\r\n> I think we can improve the error message by including a note like this:\r\n> \r\n> ```\r\n> Value accessor was not provided as an array for form control with unspecified name attribute.\r\n> Please make sure that the `NG_VALUE_ACCESSOR` token is configured as a multi provider (with the `multi: true` property).\r\n> ```\r\n> \r\n> I think there might also be an opportunity to improve the logic around getting the attribute name (so that there is a real name vs \"unspecified attribute\").\r\n\r\n### Alternatives considered\r\n\r\n—","author":{"url":"https://github.com/mwaibel-go","@type":"Person","name":"mwaibel-go"},"datePublished":"2021-12-15T09:42:38Z","url":"https://github.com/angular/angular/issues/44486"}

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:a7c0b545-6990-8923-ace9-d10c82d0321a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC388:E3C4F:1065576:14ECA3E:6B0116CE
html-safe-nonce2d42f1406ae161e59a4ba1c46d4d19cb6a2b3dd046996f017c1d49965c91ac24
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzg4OkUzQzRGOjEwNjU1NzY6MTRFQ0EzRTo2QjAxMTZDRSIsInZpc2l0b3JfaWQiOiI4MjI1Mjg5ODU2MDI1MTcxNjYyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9cd8db23845a78483592b44f08dacc2ae4bd19a173dca4246ed40c0fb07c6275
hovercard-subject-tagissue:1080806612
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/44486/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a34dd5aa41f539a5a60c48bca8c70aef3be50e8131d6963619f331d21f0abb6a/angular/angular/issues/44486
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a34dd5aa41f539a5a60c48bca8c70aef3be50e8131d6963619f331d21f0abb6a/angular/angular/issues/44486
og:image:altWhich @angular/* package(s) are relevant/releated to the feature request? forms Description I was hitting the following error when implementing a custom form control: ERROR Error: Value accessor wa...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemwaibel-go
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/44486#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F44486
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%2F44486
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/44486
Reloadhttps://github.com/angular/angular/issues/44486
Reloadhttps://github.com/angular/angular/issues/44486
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/44486
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/44486
Unclear error message for badly configured custom form controlshttps://github.com/angular/angular/issues/44486#top
https://github.com/ameryousuf
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
feature: in backlogFeature request for which voting has completed and is now in the backloghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20in%20backlog%22
good first issueLabel noting a good first issue to be worked on by a community memberhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
hotlist: error messageshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22hotlist%3A%20error%20messages%22
open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22open%20for%20contributions%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/mwaibel-go
mwaibel-gohttps://github.com/mwaibel-go
on Dec 15, 2021https://github.com/angular/angular/issues/44486#issue-1080806612
source code for the testhttps://github.com/angular/angular/blob/master/packages/forms/test/directives_spec.ts#L53
#3011https://github.com/angular/angular/issues/3011
https://stackblitz.com/edit/angular-ivy-e2wj4z?file=src/app/app.component.tshttps://stackblitz.com/edit/angular-ivy-e2wj4z?file=src/app/app.component.ts
proposed a solutionhttps://github.com/angular/angular/issues/44486#issuecomment-996307788
AndrewKushnirhttps://github.com/AndrewKushnir
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
hotlist: error messageshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22hotlist%3A%20error%20messages%22
on Dec 17, 2021https://github.com/angular/angular/issues/44486#event-5781704451
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular/milestone/82
on Dec 17, 2021https://github.com/angular/angular/issues/44486#event-5781704486
AndrewKushnirhttps://github.com/AndrewKushnir
feature: in backlogFeature request for which voting has completed and is now in the backloghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20in%20backlog%22
open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22open%20for%20contributions%22
on Dec 17, 2021https://github.com/angular/angular/issues/44486#event-5781704598
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Dec 17, 2021https://github.com/angular/angular/issues/44486#issuecomment-996307788
@mwaibel-gohttps://github.com/mwaibel-go
angular/packages/forms/src/directives/shared.tshttps://github.com/angular/angular/blob/8ebc946c0e7bf80d26ec8268acb4ff0af9e5c34a/packages/forms/src/directives/shared.ts#L317-L318
8ebc946https://github.com/angular/angular/commit/8ebc946c0e7bf80d26ec8268acb4ff0af9e5c34a
Stackblitzhttps://stackblitz.com/
https://github.com/mwaibel-go
mwaibel-gohttps://github.com/mwaibel-go
on Dec 21, 2021https://github.com/angular/angular/issues/44486#issuecomment-998742613
https://github.com/bleistift-zwei
bleistift-zweihttps://github.com/bleistift-zwei
on Dec 22, 2021https://github.com/angular/angular/issues/44486#issuecomment-999795381
https://stackblitz.com/edit/angular-ivy-e2wj4z?file=src/app/app.component.tshttps://stackblitz.com/edit/angular-ivy-e2wj4z?file=src/app/app.component.ts
https://github.com/ameryousuf
ameryousufhttps://github.com/ameryousuf
on Feb 8, 2022https://github.com/angular/angular/issues/44486#issuecomment-1032939748
@AndrewKushnirhttps://github.com/AndrewKushnir
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Feb 8, 2022https://github.com/angular/angular/issues/44486#issuecomment-1032942433
@ameryousufhttps://github.com/ameryousuf
AndrewKushnirhttps://github.com/AndrewKushnir
ameryousufhttps://github.com/ameryousuf
on Feb 8, 2022https://github.com/angular/angular/issues/44486#event-6029066087
https://github.com/ameryousuf
ameryousufhttps://github.com/ameryousuf
on Feb 24, 2022https://github.com/angular/angular/issues/44486#issuecomment-1049936380
@AndrewKushnirhttps://github.com/AndrewKushnir
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Mar 1, 2022https://github.com/angular/angular/issues/44486#issuecomment-1054950154
@ameryousufhttps://github.com/ameryousuf
#45192https://github.com/angular/angular/pull/45192
https://github.com/ameryousuf
ameryousufhttps://github.com/ameryousuf
on Mar 13, 2022https://github.com/angular/angular/issues/44486#issuecomment-1066160397
@AndrewKushnirhttps://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22open%20for%20contributions%22
on Mar 15, 2022https://github.com/angular/angular/issues/44486#event-6239844944
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Mar 15, 2022https://github.com/angular/angular/issues/44486#issuecomment-1067493646
@ameryousufhttps://github.com/ameryousuf
https://github.com/ameryousuf
ameryousufhttps://github.com/ameryousuf
on Mar 15, 2022https://github.com/angular/angular/issues/44486#issuecomment-1067595847
@AndrewKushnirhttps://github.com/AndrewKushnir
dylhunnhttps://github.com/dylhunn
open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22open%20for%20contributions%22
good first issueLabel noting a good first issue to be worked on by a community memberhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
on Jun 29, 2022https://github.com/angular/angular/issues/44486#event-6899040440
https://github.com/akushnarov
akushnarovhttps://github.com/akushnarov
on Jul 22, 2022https://github.com/angular/angular/issues/44486#issuecomment-1192330060
@dylhunnhttps://github.com/dylhunn
@AndrewKushnirhttps://github.com/AndrewKushnir
45192https://github.com/angular/angular/pull/45192
https://github.com/ashide2729
ashide2729https://github.com/ashide2729
on Jul 22, 2022https://github.com/angular/angular/issues/44486#issuecomment-1192730594
thishttps://github.com/angular/angular/issues/44486#issuecomment-1054950154
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Jul 22, 2022https://github.com/angular/angular/issues/44486#issuecomment-1192767222
#45192https://github.com/angular/angular/pull/45192
AndrewKushnirhttps://github.com/AndrewKushnir
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 22, 2022https://github.com/angular/angular/issues/44486#event-7047903514
https://github.com/ashide2729
ashide2729https://github.com/ashide2729
on Jul 23, 2022https://github.com/angular/angular/issues/44486#issuecomment-1193089111
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Aug 23, 2022https://github.com/angular/angular/issues/44486#issuecomment-1224283825
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 Aug 23, 2022https://github.com/angular/angular/issues/44486#event-7243437613
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/44486
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/44486
ameryousufhttps://github.com/ameryousuf
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
feature: in backlogFeature request for which voting has completed and is now in the backloghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20in%20backlog%22
good first issueLabel noting a good first issue to be worked on by a community memberhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
hotlist: error messageshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22hotlist%3A%20error%20messages%22
open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22open%20for%20contributions%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.