form icon indicating copy to clipboard operation
form copied to clipboard

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

Open maplion opened this issue 7 years ago • 2 comments

This is a...

  • [ x ] bug report

What toolchain are you using for transpilation/bundling?

  • [x ] @angular/cli

Environment

Angular CLI: 6.0.8
Node: 8.9.4
OS: win32 x64
Angular: 6.0.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

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.

maplion avatar Jun 11 '18 21:06 maplion

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

anodynos avatar Jul 06 '18 10:07 anodynos

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?

smithad15 avatar Jul 09 '18 00:07 smithad15