Search code examples
angular5form-control

Custom FormControl Failed after update from Angular 4 to Angular 5


after upgrading from Angular 4.4.6 to Angular 5.2.10 got strange errors for my form control.

Attempting to configure '__source' with descriptor '{"value":"FormControlDirective","configurable":true}' on object 'InjectionToken NgValueAccessor' and got error, giving up: TypeError: Cannot redefine property: __source

I didn't found any GitHub issue or stackoverflow answer for this, any body know what is it and how to resolve it?


Solution

  • I think you faced with a problem with ngrx-store-freeze if you use it.

    ngrx-store-freeze freezes the contents of the store and the Angular view layer expects the DI tokens to be mutable, as it appends a __source property to track where they've come from, or something. When it tries to this but discovers they're frozen, that's when this error is logged.

    details: https://github.com/ngrx/platform/issues/1104#issuecomment-479945199