jQuery UI Widgets › Forums › Angular › jQWidgets 4.5.1 TypeScript errors
Tagged: 4.5.1., angular 5, Typescripts
This topic contains 20 replies, has 9 voices, and was last updated by Martin 6 years, 8 months ago.
-
Author
-
Hi,
I am using jQWidgets 4.5.1. After upgrading from jQWidgets 4.5.0 webpack reports the following errors:
jqwidgets-ts/jqwidgets.d.ts (1979,9): Duplicate identifier 'localization' jqwidgets-ts/jqwidgets.d.ts (2004,9): Duplicate identifier 'localization' jqwidgets-ts/jqwidgets.d.ts (2004,9): Subsequent variable declarations must have the same type. Variable 'localization' must be of type 'any', but here has type 'Object'. jqwidgets-ts/angular_jqxcalendar.ts (531,11): Cannot find name 'value'. Did you mean the instance member 'this.value'? jqwidgets-ts/angular_jqxcomplexinput.ts (288,11): Cannot find name 'value'. Did you mean the instance member 'this.value'? jqwidgets-ts/angular_jqxgrid.ts (100,27): Duplicate identifier 'attrLocalization'. jqwidgets-ts/angular_jqxgrid.ts (696,4): Duplicate function implementation. jqwidgets-ts/angular_jqxgrid.ts (896,4): Duplicate function implementation.
Best regards,
DanielDid you check your tsconfig.json with the one on the site? I thought i had this error also today.
Hi Daniel,
There is indeed a duplication with the ‘localization’ property.
For the ‘value’ errors we can`t seem to find an error.
Thanks for the report!Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/Hi Ivo,
as far I can see the val() function’s signature in angular_jqxcalendar.ts (line 530) changed from (jQWidgets 4.5.0)
val(arg?: String | Number): any { if (arg !== undefined) { ...
to (jQWidgets 4.5.1)
val(date, date2): any { if (value !== undefined) { ...
In 4.5.0 the argument ‘arg’ was checked whether it is undefined or not. But in 4.5.1 there is no argument named ‘value’. So typescript cannot resolve this variable.
Best regards,
Daniel@Ivo Zhulev, is there a patch to fix the Typescript error?
What is the ETA for the patch?
Or if there is a workaround, can you share it?Do you suggest we roll back to the previous version?
Thanks
YongHi yongchen45,
The workaround – just match the arguments in the angular_jqxxxxxx files.
Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/Ivo,
I am not quite understanding your suggestion.
Can you put some code snippets as example?
I.e. jqxButton jqxGridThanks
Ivo,
I have not heard from you.
Are you suggesting WE change the source code we downloaded?
If so, what’s the plan that in next release that we don’t have to do this all over again?Thanks
Hi yongchen45,
Just go to let’s say
angular_jqxbutton.ts
file, find the prop you get errors from – lets sayval
, and match the types and names of the arguments:val(date, date2): any { if (value !== undefined) {
to:
val(date: any, date2: any): any { if (date!== undefined) {
These files are not minimized because in some cases you will need to change something there in order to get some custom things for your project.
As for the next release, you won’t have to change anything in your code.Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/While I can use this workaround for myself, it is getting a bit frustrating on our build systems. Will this be fixed soon so we do not have to do this?
Also, there is a conflict in the jqwidgets.d.ts definitions on line 9. It reads:
declare var $: any;
It should be:
declare var $: JQueryStatic;
Thanks for all your help. Look forward to hearing from you.
Hi kryptonianson,
This errors won’t be in the next release which will be this month.
As for thedeclare var $: any;
-> thanks for that propose. I’ll look into it.Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/I would like to clarify what I mean by the jQuery conflict. This is specifically with the @types/jquery definitions. I hope this helps. Thank you again.
I’d like to say that we have the same issue.
Our app references (implicitly, because of another dependency we have) “@types/jquery”. This makes compilation fail with the following message:jqwidgets-ts/jqwidgets.d.ts (9,13): Subsequent variable declarations must have the same type. Variable ‘$’ must be of type ‘JQueryStatic’, but here has type ‘any’.
I think, jqwidgets should also reference “@types/jquery” to be a good citizen in the TypeScript world :). The change looks trivial on its surface … Is there any chance for that happening in the near future?
Hi Dmytro Gokun,
Are you sure you are running on jQWidgets version 4.5.3?
Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.