angular-redux / form

Keep your Angular2+ form state in Redux
MIT License
41 stars 15 forks source link

Issues with null initial states for form objects when upgrading from 6.6.0 to 9.0.1 #61

Open maplion opened 6 years ago

maplion commented 6 years ago

This is a...

What toolchain are you using for transpilation/bundling?

Package Version

@angular-devkit/architect 0.6.8 @angular-devkit/build-angular 0.6.8 @angular-devkit/build-optimizer 0.6.8 @angular-devkit/core 0.6.8 @angular-devkit/schematics 0.6.8 @angular/cli 6.0.8 @ngtools/webpack 6.0.8 @schematics/angular 0.6.8 @schematics/update 0.6.8 rxjs 6.2.0 typescript 2.7.2 webpack 4.8.3



### Expected Behaviour:
Connect to an empty form without issue.

### Actual Behaviour:
After upgrading 6.6.0 => 9.0.1, if the initial state of the form was null, it would crash on trying to connect before any state changes were made; it's now expecting initial values when before it didn't care.  If this is intended, then it would be good to have it documented as before I had a form as null until an @angular-redux/form action was fired.

### Stack Trace/Error Message:
State.traverse line 26 (e.g. can't call <formControlName> on a null object).
Another
`core.js:1542 ERROR Error: Uncaught (in promise): Error: Must supply a value for form control with name: '<formControlName>'.
Error: Must supply a value for form control with name: '<formControlName>'.`

## Additional Notes
We used @angular-redux/form in a production-level application that is using @angular-redux/form 6.6.0 and Angular 5.2.6 and are trying to upgrade it to Angular 6 for access to i18n.
anodynos commented 6 years ago

Any news with this? Is version 9 tested with Angular 6 by anyone?

smithad15 commented 6 years ago

Maybe I don't quite understand the scenario, but I have been unable to replicate this. If I pass null as the initial value to a control, I am not seeing any errors.

Can someone please provide a sample repo/project that shows this bug in action?