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

13 posts, 0 answers
  1. Jeffrey
    Jeffrey avatar
    15 posts
    Member since:
    Dec 2010

    Posted 31 Mar 2015 Link to this post

    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
  2. Jeffrey
    Jeffrey avatar
    15 posts
    Member since:
    Dec 2010

    Posted 01 Apr 2015 in reply to Jeffrey Link to this post

    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
  3. Kendo UI is VS 2017 Ready
  4. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 02 Apr 2015 Link to this post

    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!
     
  5. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 15 Apr 2015 in reply to Petyo Link to this post

    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)

  6. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 16 Apr 2015 Link to this post

    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!
     
  7. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 18 Apr 2015 in reply to Jeffrey Link to this post

    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

  8. Jeffrey
    Jeffrey avatar
    15 posts
    Member since:
    Dec 2010

    Posted 18 Apr 2015 in reply to Morten Link to this post

    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

     

     

     

  9. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 18 Apr 2015 in reply to Jeffrey Link to this post

    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


  10. Jeffrey
    Jeffrey avatar
    15 posts
    Member since:
    Dec 2010

    Posted 18 Apr 2015 in reply to Morten Link to this post

    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

  11. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 06 May 2015 in reply to Jeffrey Link to this post

    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" />

  12. Nick
    Nick avatar
    86 posts
    Member since:
    Mar 2008

    Posted 11 Jun 2015 in reply to Petyo Link to this post

    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.

     

  13. Nick
    Nick avatar
    86 posts
    Member since:
    Mar 2008

    Posted 11 Jun 2015 in reply to Nick Link to this post

    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.

     

  14. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 15 Jun 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready