This is a migrated thread and some comments may be shown as answers.

Compilation error for kendo.all.d.ts and jquery.d.ts 2.2.3

12 Answers 223 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Jeffrey asked on 01 Apr 2015, 03:51 AM
After upgraded to version 2.2.3, jquery.d.ts failed to compile and throw this error in my VS2013 with TypeScript tool 1.4:

Error 545 Interface 'JQueryPromise' incorrectly extends interface 'JQueryGenericPromise'.
Types of property 'then' are incompatible.
Type '(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any) => JQueryPromise' is not assignable to type '{ (doneFilter: (value?: T, ...values: any[]) => U | JQueryPromise, failFilter?: (...reasons...'.
Type 'JQueryPromise' is not assignable to type 'JQueryPromise'.
Type 'T' is not assignable to type 'void'. X:\Web\Scripts\typings\jquery\jquery.d.ts @ Lines: 304 Column: 11Use Package Management Console reinstall version 2.2.2, it works fine.

Then I found that the issue happened only when using Kendo UI's TypeScript definition, kendo.all.d.ts, with jQuery definition 2.2.3, but I am not sure which definition should be modified.  I have reported it on Github, but I think Kendo team can help.

Here is a simple project to reproduce the issue: https://www.dropbox.com/s/qfemleptefy5stp/JQTSTest.zip?dl=0

12 Answers, 1 is accepted

Sort by
0
Jeffrey
Top achievements
Rank 1
answered on 01 Apr 2015, 09:43 AM
Update:

In kendo.all.d.ts (line 15060)
interface JQueryPromise<T> {
  pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<T>;
  then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryPromise<T>;
}

is not compatible with jQuery definition 2.2.3.

Reference: https://github.com/borisyankov/DefinitelyTyped/issues/3976#issuecomment-88411743
0
Petyo
Telerik team
answered on 02 Apr 2015, 04:38 PM
Hello Jeffry,

thank you very much for the report and for the linked resources; we will investigate it further and hopefully address it soon. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Morten
Top achievements
Rank 1
Veteran
answered on 15 Apr 2015, 11:08 AM

I'm getting this error to.

I have:

// Type definitions for jQuery 1.10.x / 2.0.x

// Type definitions for Kendo UI (included in th e kendoui.professional.2015.1.408.commercial distribution file)

0
Petyo
Telerik team
answered on 16 Apr 2015, 03:59 PM
Hello Morten,

Please accept our apologies; the problem is not yet addressed. We will look into resolving it soon.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Morten
Top achievements
Rank 1
Veteran
answered on 18 Apr 2015, 05:19 AM

Hi Jeffrey

I recently decided to migrate my coffee scripts to typescript, however, upon first attempt at migrating anything kendo related VS displayed the compilation error you experienced too.

 

It made me winder if migrating my kendo related coffee scripts to typescript is possible. I presume that the kendo.all.d.ts file must be updated with every kendo.all.js update. 

Have you been writing typescripts with kendo references for a long time?

Is this the first time you have this error?

 /Morten

0
Jeffrey
Top achievements
Rank 1
answered on 18 Apr 2015, 05:51 AM

Morten,

I have been writing TypeScirpt with Kendo references for more than one year, the compilation error happened only after jQuery.d.ts upgraded to 2.2.3 one month ago. Everything goes fine before 2.2.2.

It's easy to fix this issue by comment interface JQueryPromise<T> declaration in kendo.all.d.ts as a workaround, and I believe Telerik will fix it soon.  Don't worry about using TypeScript with Kendo UI, just do it!  Have fun.

Regards,
Jeffrey

 

 

 

0
Morten
Top achievements
Rank 1
Veteran
answered on 18 Apr 2015, 08:15 AM

Thanks Jeffrey

one last question (ts is fairly new to me). After commenting the interface JQueryPromise<T> the VS2013 solution builds alright, however in my "Error list" window I now get one error for every class implementing the interface.

1069 Cannot find name 'JQueryPromise'. C:\Projects\WebSite\Scripts\typings\kendo\kendo.all.d.ts 374 11 kendo.all.d.ts

54 errors in all.

Do I need to worry about this?

 /Morten


0
Jeffrey
Top achievements
Rank 1
answered on 18 Apr 2015, 09:02 AM

Morten, 

In my test, commenting line 15060-15063 of kendo.all.d.ts fixed the error, and I can use JQueryPromise<T> in my TypeScript without any error.  Do you reference jquery.d.ts in your project? There is an official JQueryPromise<T> declaration inside jquery.d.ts, for kendo.all.d.ts to use. For your reference.

Jeffrey

0
Morten
Top achievements
Rank 1
Veteran
answered on 06 May 2015, 05:32 PM

Hi Jeffrey

Thanks for your reply.

For reference:

- I updated to 2015.1.430 version of kendo.all.d.ts

- commented out the interface "interface JQueryPromise<T> {" (lines 15376-15379 in the file kendo.all.d.ts).

- referenced jquery.d.ts in kendo.all.d.ts     /// <reference path="jquery/jquery.d.ts" />

0
Nick
Top achievements
Rank 1
answered on 11 Jun 2015, 10:24 AM

I'm having the same problem in kendo.web.d.ts on version 2015.1.429

Commenting out the interface as in previous comments has allowed the project to build again.

 

0
Nick
Top achievements
Rank 1
answered on 11 Jun 2015, 10:35 AM

Oh, and tslint spammed 500 warnings into my error console about this file.  I had to add  /* tslint:disable */  at the top of the file to get Web Essentials to ignore it.

 

0
Petyo
Telerik team
answered on 15 Jun 2015, 08:07 AM
Hi Nick,

thanks for sharing that info - we will run the tslint on the file and see if we can fix the errors. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Jeffrey
Top achievements
Rank 1
Answers by
Jeffrey
Top achievements
Rank 1
Petyo
Telerik team
Morten
Top achievements
Rank 1
Veteran
Nick
Top achievements
Rank 1
Share this question
or