{"record":{"id":"eef223209078e061","repo":"marmelab/react-admin","slug":"invalid-form-group-group","errorCode":null,"errorMessage":"Invalid form group ${group}","messagePattern":"Invalid form group (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/ra-core/src/form/groups/FormGroupsProvider.tsx","lineNumber":66,"sourceCode":"                if (group != null) {\n                    if (!(formGroups.current[group] || []).includes(source)) {\n                        formGroups.current[group] = [\n                            ...(formGroups.current[group] || []),\n                            source,\n                        ];\n                        // Notify subscribers that the group fields have changed\n                        if (subscribers.current[group]) {\n                            subscribers.current[group].forEach(subscriber =>\n                                subscriber()\n                            );\n                        }\n                    }\n                }\n            },\n            unregisterField: (source, group) => {\n                if (group != null) {\n                    if (!formGroups.current[group]) {\n                        console.warn(`Invalid form group ${group}`);\n                    } else {\n                        const fields = new Set(formGroups.current[group]);\n                        fields.delete(source);\n                        formGroups.current[group] = Array.from(fields);\n\n                        // Notify subscribers that the group fields have changed\n                        if (subscribers.current[group]) {\n                            subscribers.current[group].forEach(subscriber =>\n                                subscriber()\n                            );\n                        }\n                    }\n                }\n            },\n        }),\n        []\n    );\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/ra-core/src/form/groups/FormGroupsProvider.tsx#L48-L84","documentation":"FormGroupsProvider's unregisterField checks that the group the field claims to belong to exists in the form's group registry. If a field tries to unregister from a group that was never registered (or was already removed), react-admin warns 'Invalid form group <name>'.","triggerScenarios":"A useInput-based component passes a groupName that was never declared via FormGroupContextProvider/FormGroupsProvider, or the group unmounts before its fields (ordering issue), leaving unregisterField called with an unknown group.","commonSituations":"Typos in group names between FormGroupContextProvider and input groupName props; conditional rendering that removes the group provider while inputs remain; custom inputs wired with wrong group constants.","solutions":["Ensure every input's groupName matches an existing FormGroupContextProvider name in the same form.","Keep FormGroupContextProvider mounted as long as its fields are mounted (check conditional rendering order).","Centralize group names in shared constants to avoid typos."],"exampleFix":"// before\n<TextInput source=\"city\" groupName=\"adress\" /> {/* typo */}\n// after\n<FormGroupContextProvider name=\"address\">\n  <TextInput source=\"city\" groupName=\"address\" />\n</FormGroupContextProvider>","handlingStrategy":"validation","validationCode":"const GROUPS = { address: 'address' };\nconst useValidGroupName = (name) => {\n  if (!Object.values(GROUPS).includes(name)) throw new Error(`Unknown form group: ${name}`);\n  return name;\n};","typeGuard":"const isKnownGroup = (name, groups) => name != null && name in groups;\nif (!isKnownGroup(groupName, registeredGroups)) throw new Error(`Invalid form group ${groupName}`);","tryCatchPattern":null,"preventionTips":["Define group names as shared constants and use them in both provider and inputs.","Keep FormGroupContextProvider mounted whenever its grouped inputs are mounted.","Avoid dynamic group names built from data without validation."],"tags":["forms","groups","react-admin"],"backgroundTag":"unregistered-form-group","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}