Troubleshooting
May 18, 2026 · View on GitHub
Common issues and solutions when using FormLens.
Setup issues
The FAB button does not appear
Symptoms: The page loads but the floating action button is not visible anywhere.
Check:
- Confirm
provideFormLens()is registered in yourapp.config.tsproviders array. - Confirm the app is running in development mode (
isDevMode()returnstrueif you wrapped the provider conditionally). - Check the browser console for Angular DI errors on startup.
- Make sure
@angular/cdkis installed — FormLens uses the CDK overlay.
// app.config.ts — required
providers: [provideFormLens()]
The panel opens but no forms appear
Symptoms: The FAB works and the panel opens, but the form list is empty.
Check:
- Confirm the form element has both
[formGroup]andformLenson the same element. - Confirm
FormLensDirectiveis imported in the component that owns the form. - Confirm the form is a Reactive Form — template-driven forms are not supported in the current alpha.
// Component — import required
imports: [ReactiveFormsModule, FormLensDirective]
<!-- Template — both attributes required on the same element -->
<form [formGroup]="myForm" formLens formLensName="My form">
Multiple instances of FormLens panel appear
Symptoms: Two or more panels stack on top of each other.
Cause: provideFormLens() was called more than once — once in the root config and again in a lazy-loaded module or child injector.
Fix: Call provideFormLens() once, only in the root app.config.ts.
Highlighting issues
Invalid fields are not highlighted
Symptoms: Controls are invalid (red border from your app's CSS), but the FormLens outline does not appear.
Check:
- Confirm
overlayInvalidControlsis not explicitly set tofalse. - Confirm the control uses
formControlName— controls bound via template-drivenngModelare not tracked. - Confirm the field is actually
INVALID(notPENDING). Check the status in the inspector panel. - For nested
FormGrouporFormArray, check that the parent form is registered withformLens.
Highlight stays visible after the form becomes valid
Symptoms: The outline does not disappear after fixing a validation error.
Cause: This is a known limitation in the current alpha for some edge cases with dynamic form structures.
Workaround: Toggle the panel closed and open again to force a highlight refresh.
Highlight does not appear on deeply nested controls
Symptoms: Top-level controls highlight correctly, but controls inside nested FormGroup or FormArray do not.
Status: This is a known gap in the current alpha. Improved highlight mapping for deep structures is planned for a near-term release. See ROADMAP.md.
Inspector panel issues
The panel does not update when I change form values
Symptoms: The tree or details section shows stale data that does not reflect current control values.
Check:
- Make sure the form control is connected —
formControlNamemust match an existing key in the parentFormGroup. - Check the browser console for
Cannot find control with nameerrors. - If using a dynamically-built form, make sure controls are added to the
FormGroupbefore the component mounts and the directive initializes.
The selected control in the panel does not match what I clicked
Symptoms: Clicking a node in the tree selects a different node.
Cause: This can happen with deep nested paths that share a prefix (e.g., address and address.street).
Workaround: Use the search box to locate the specific path and click from the filtered result.
Panel scroll does not work
Symptoms: The panel is open but the content is cut off and cannot be scrolled.
Check:
- Confirm no global CSS in your app sets
overflow: hiddenonbodyor a high-level container. - Check if your app's CDK overlay configuration overrides scroll strategy.
Build and packaging issues
Cannot find module 'form-lens-angular'
Symptoms: TypeScript compilation fails with a module resolution error after installation.
Check:
- Run
npm installto ensure the package is installed. - Check your
tsconfig.jsonforpathsaliases that might intercept the import. - If testing locally with
npm pack, make sure you ranng build formlens --configuration productionfirst and linked the dist folder correctly.
Tree-shakeable warnings in build output
Symptoms: The Angular build emits warnings about non-tree-shakeable providers.
Cause: The FAB initializer uses APP_INITIALIZER, which is not tree-shakeable by default.
Status: This is a known constraint in the current alpha architecture. The warning is harmless for a dev-only tool.
Getting more help
If none of the above resolves your issue:
- Check the GitHub Issues to see if it has been reported.
- Open a new issue with:
- Angular version and FormLens version
- Minimal reproduction (component + template)
- Browser console errors
- Description of expected vs. actual behavior