tb / ng2-nouislider

Angular2 noUiSlider directive
http://tb.github.io/ng2-nouislider/
MIT License
184 stars 114 forks source link

nativeElement.querySelector not a function #86

Closed ergodaveh closed 7 years ago

ergodaveh commented 7 years ago

I've attempt to use the slider component in my Angular 2 project as receive this error message.

An unhandled exception occurred while processing the request. Exception: Call to Node module failed with error: TypeError: this.el.nativeElement.querySelector is not a function at NouisliderComponent.ngOnInit (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\ng2-nouislider\src\nouislider.js:94:63) at AppView._View_SliderComponent0.detectChangesInternal (SliderComponent.ngfactory.js:924:89) at AppView.detectChanges (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\@angular\core\bundles\core.umd.js:9566:18) at AppView.detectViewChildrenChanges (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\@angular\core\bundles\core.umd.js:9592:23) at AppView._View_SliderComponent_Host0.detectChangesInternal (SliderComponent_Host.ngfactory.js:30:8) at AppView.detectChanges (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\@angular\core\bundles\core.umd.js:9566:18) at AppView.detectContentChildrenChanges (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\@angular\core\bundles\core.umd.js:9584:23) at AppView.detectChangesInternal (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\@angular\core\bundles\core.umd.js:9576:18) at AppView.detectChanges (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Testing\Angular2Testing\node_modules\@angular\core\bundles\core.umd.js:9566:18) at AppView.detectViewChildrenChanges (C:\Users..\Documents\Visual Studio 2015\Projects\Angular2Test\node_modules\@angular\core\bundles\core.umd.js:9592:23)

Not sure how to debug this exception.

This condition seems to be associated with the asp-prerender-module. Once I removed/ disabled the decorator asp-prerender-module="blah blah" the components within the demo examples began to resolve

CramericaIndustries commented 7 years ago

+1; have the same issue when launching my Angular 4 app with Angular Universal