I upgraded kendo-angular-grid from version 1.6.1(running fine) to version 2.0.0. After the upgrade any instances of the GridComponent throw exception "TypeError: Class constructor EventEmitter cannot be invoked without 'new'". I am running my project with angular 5.1.0 and angular/cli v1.6.1 and targeting the typescript build for es2016. When I change my target to es5 the problem goes away. Problem persists when targeting es2015. I have tracked the error to
progress/kendo-angular-grid/dist/es/common/event-emitter.js, the constructor of ZoneAwareEventEmitter. Basically it tries to instantiate an instance of the angular EventEmitter with .call() but that type of call is not allowed in es2016, nor es2015, from what I have read.
I expect the the GridComponent to output proper es2016 code if I target it. I have not experienced similar issues in any other kendo angular component nor in previous versions of GridComponent. Every release after v1.6.1, all the way to v2 has the issues.
npm install @angular/[email protected] -g@progress/kendo-angular-grid and any dependencies.import { GridModule } from "@progress/kendo-angular-grid"; to app.module.ts and import it into AppModule.<kendo-grid></kendo-grid>I wanted to upgrade to latest version of the kendo grid to stay up-to-date with latest features and bug fixes but I also want to keep targeting es2016 to take advantage of smaller package sizes and faster execution.
Package versions:
+-- @angular-devkit/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @angular/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @progress/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
Browser:
System:
Pretty neat to see that you're using ES2016 code in the browser :)
The issue seems to be caused by the fact that we ship only es5 bundles. As a result the ZoneAwareEventEmitter function "extends" the EventEmitter class from the Angular ES2015 bundle.
We should be able to fix this by shipping an ES2015 bundle in the packages.
Related to angular/angular-cli#8910 and Microsoft/TypeScript#15397
Will the es2015 bundle be included in the next version of the package?
The latest dev version of the Grid package adds an ES2015 bundle. This should resolve this issue and hopefully improve performance in modern browsers.
We'll continue with the rest of the packages over the next few days.
All packages now ship ES2015 bundles in their latest dev versions. Feel free to give them a spin.
Fixed in @progress/kendo-angular-grid v2.0.2
Fixed in all latest package versions.
Just noticed that this no longer works in Angular 6 production builds. Disabling the build optimizer seems to fix it, see angular/angular-cli#10658
Facing same issue in latest version "@progress/kendo-angular-grid": "^5.0.3", with angular 12.0.0-rc.0
@vishalmote can you please try upgrading to the development build?
npm install --save @progress/kendo-angular-grid@dev
Most helpful comment
The latest dev version of the Grid package adds an ES2015 bundle. This should resolve this issue and hopefully improve performance in modern browsers.
We'll continue with the rest of the packages over the next few days.