-
Notifications
You must be signed in to change notification settings - Fork 216
kendo-angular-grid upgrading beyond 1.6.1 and targeting es2016 throws TypeError #1288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 |
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?
|
I'm submitting a Bug report
Current behavior
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.
Expected behavior
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.
Minimal reproduction of the problem with instructions
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>
ERROR TypeError: Class constructor EventEmitter cannot be invoked without 'new'
at new ZoneAwareEventEmitter (event-emitter.js:10)
at new GridComponent (grid.component.js:212)
at createClass (core.js:10365)
at createDirectiveInstance (core.js:10200)
at createViewNodes (core.js:11657)
at callViewAction (core.js:12091)
at execComponentViewsAction (core.js:12000)
at createViewNodes (core.js:11685)
at createRootView (core.js:11546)
at callWithDebugContext (core.js:12912)
What is the motivation or use case for changing the behavior?
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.
Environment
Package versions:
Browser:
System:
The text was updated successfully, but these errors were encountered: