CRITICAL ISSUE RESOLVED: Fixed Angular Forms initialization error that was preventing Login, Register, and CV Builder pages from rendering.
Angular Package Version Mismatch causing TypeError: Cannot read properties of null (reading 'firstCreatePass')
The application had mixed versions of Angular packages:
@angular/core@20.3.1 (some instances)@angular/core@20.3.2 (other instances)@angular/forms@20.3.2This version inconsistency caused the Angular Forms module's initialization to fail, resulting in null reference errors when the form directives tried to access internal Angular properties.
frontend/recruitment-portal/src/app/components/auth/login/login.ts)frontend/recruitment-portal/src/app/components/auth/register/register.ts)frontend/recruitment-portal/src/app/components/cv-builder/steps/personal-info-step/personal-info-step.ts)Updated package.json to use exact versions (removed ^ prefix) for all Angular packages to ensure consistency:
"dependencies": {
"@angular/animations": "20.3.2",
"@angular/cdk": "20.2.5",
"@angular/common": "20.3.2",
"@angular/compiler": "20.3.2",
"@angular/core": "20.3.2",
"@angular/forms": "20.3.2",
"@angular/material": "20.2.5",
"@angular/platform-browser": "20.3.2",
"@angular/router": "20.3.2"
},
"devDependencies": {
"@angular/build": "20.3.2",
"@angular/cli": "20.3.2",
"@angular/compiler-cli": "20.3.2"
}
# In root directory
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
Used Kapture MCP to test all previously broken pages on http://localhost:4201:
| Component | Status Before | Status After | Console Errors | |-----------|---------------|--------------|----------------| | Login Page | ❌ Blank screen | ✅ Form renders correctly | 0 errors | | Register Page | ❌ Blank screen | ✅ Form renders correctly | 0 errors | | CV Builder (Personal Info) | ❌ No form fields | ✅ All fields render | 0 errors |
Login Page:
Register Page:
CV Builder - Personal Info:
Before Fix:
TypeError: Cannot read properties of null (reading 'firstCreatePass')
at providersResolver (@angular_forms.js:18597:13)
at definition.providersResolver (@angular_forms.js:18765:14)
at initializeDirectives (chunk-KAYLQCZ5.js:8105:11)
After Fix:
✅ No errors
ℹ️ Angular is running in development mode
ℹ️ [vite] connected
⚠️ NG0913: Image optimization warning (non-critical)
The package.json used caret (^) version ranges like "^20.3.0", which allows npm to install minor and patch updates. This resulted in:
20.3.120.3.2Angular's strict internal APIs require exact version matching between core modules, especially for:
By pinning exact versions (removing ^):
./mvnw spring-boot:run)package-lock.json more strictly# Always use exact versions for Angular packages
"@angular/core": "20.3.2" # ✅ Good
"@angular/core": "^20.3.0" # ❌ Can cause version drift
# After updating any Angular package
npm install --legacy-peer-deps
npm list @angular/core @angular/forms # Verify versions match
# Before commits
npm run build # Ensure no build errors
npm run lint # Check for issues
frontend/recruitment-portal/package.json - Updated Angular dependency versionssrc/app/components/auth/login/login.ts - Working after fixsrc/app/components/auth/register/register.ts - Working after fixsrc/app/components/cv-builder/steps/personal-info-step/personal-info-step.ts - Working after fix✅ Forms Rendering Test: PASS
✅ No Console Errors: PASS
✅ Form Validation: PASS
✅ User Input: PASS
✅ Navigation: PASS
The critical Angular Forms error has been completely resolved. All three previously broken components (Login, Register, CV Builder) are now fully functional with forms rendering correctly and no console errors.
The root cause was a simple but impactful version mismatch in Angular packages. By ensuring all Angular packages use the exact same version (20.3.2), the forms infrastructure now initializes properly.
Status: ✅ PRODUCTION READY (pending backend integration testing)
Report Generated: October 18, 2025 Fixed By: Claude Code (Automated Fix) Verified By: Kapture MCP (Automated Testing)
Reacties