tommueller / ng-mat-search-bar

An Angular 2+ component for an expandable search-icon.
MIT License
37 stars 9 forks source link

Breaking: "Cannot find control with unspecified name attribute" occurs since 3.2.0 release #15

Closed bkimminich closed 5 years ago

bkimminich commented 5 years ago

With 3.2.0 the following error occurs in my Angular tests which did not occur up until 3.1.2:

HeadlessChrome 75.0.3770 (Linux 0.0.0) AppComponent should create the app FAILED
    Error: Cannot find control with unspecified name attribute
        at _throwError (http://localhost:9876/_karma_webpack_/vendor.js:91446:11)
        at setUpControl (http://localhost:9876/_karma_webpack_/vendor.js:91354:9)
        at FormControlDirective.push../node_modules/@angular/forms/fesm5/forms.js.FormControlDirective.ngOnChanges (http://localhost:9876/_karma_webpack_/vendor.js:94366:13)
        at checkAndUpdateDirectiveInline (http://localhost:9876/_karma_webpack_/vendor.js:84690:19)
        at checkAndUpdateNodeInline (http://localhost:9876/_karma_webpack_/vendor.js:85958:20)
        at checkAndUpdateNode (http://localhost:9876/_karma_webpack_/vendor.js:85920:16)
        at debugCheckAndUpdateNode (http://localhost:9876/_karma_webpack_/vendor.js:86554:38)
        at debugCheckDirectivesFn (http://localhost:9876/_karma_webpack_/vendor.js:86514:13)
        at Object.eval [as updateDirectives] (ng:///NgMatSearchBarModule/MatSearchBarComponent.ngfactory.js:293:5)
        at Object.debugUpdateDirectives [as updateDirectives] (http://localhost:9876/_karma_webpack_/vendor.js:86506:21)
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.--Pendng async tasks are: [type: macroTask, source: setTimeout, args: {isPeriodic:false,delay:3183,args:[object Arguments],handleId:284}]

(from: https://travis-ci.org/bkimminich/juice-shop/jobs/548759748)

Pinning the dependency to 3.1.2 solves the immediate problem for me, but this might be an unintended breaking change on your end anyway.

tommueller commented 5 years ago

Shit, that sucks. Also I will not be able to fix this anytime soon, as I will be away from home and my dev-machine until end of August. Maybe you can provide a PR, I would be able to merge it, but otherwise I can only look into to it from September on. Sorry. Best, Tom

bkimminich commented 5 years ago

Version pinning work for me until September, so problem! 😁

tommueller commented 5 years ago

Closed accidentally by commit message, but this is still open :)

The error will have to do with PR #14. As I am still very limited in time, I gave it a shot with this fix, please try if it works now for you using v3.2.1. Otherwise maybe @wmattei could have a look at it? Also a repro would help, as I cannot reproduce it here. Cheers!

bkimminich commented 5 years ago

Seems to work fine now, don't get this error any longer! Thanks!