Closed HIRANO-Satoshi closed 6 years ago
Could be that jQuery and pickadate typings are not in dependencies, I'll check after Easter. Although, all our internal projects compile fine...
On Thu., 29 Mar. 2018, 8:48 pm HIRANO Satoshi, notifications@github.com wrote:
Hi, I think, since it has been converted to TS, we have the following errors.
[at-loader] Checking finished with 2 errors [at-loader] ./node_modules/aurelia-materialize-bridge/dist/commonjs/collapsible/collapsible.d.ts:14:104 TS2315: Type 'JQuery' is not generic.
[at-loader] ./node_modules/aurelia-materialize-bridge/dist/commonjs/datepicker/datepicker.d.ts:20:14 TS2304: Cannot find name 'DatePickerOptions'.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aurelia-ui-toolkits/aurelia-materialize-bridge/issues/496, or mute the thread https://github.com/notifications/unsubscribe-auth/ADimvAe0tWbf5MsJ0sNQ0htbzM6TnN--ks5tjK36gaJpZM4TADUZ .
I tested the new release 0.33.2. Thanks for it.
The DatePickerOptions issue has been gone. But we are still having the jQuery issue.
[at-loader] Checking finished with 1 errors
[at-loader] ./node_modules/aurelia-materialize-bridge/dist/commonjs/collapsible/collapsible.d.ts:14:104
TS2315: Type 'JQuery' is not generic.
The following code in collapsible.ts
buildCollapsibleOpenCloseCallbackHandler(handler: (element: Element) => {}) {
return typeof (handler) === "function" ?
(targetElementJquery: JQuery) => {
const targetElement = targetElementJquery[0];
handler(targetElement);
} : null;
}
generates the following code in collapsible.d.ts.
buildCollapsibleOpenCloseCallbackHandler(handler: (element: Element) => {}): (targetElementJquery: JQuery<HTMLElement>) => void;
I have no idea why JQuery is treated as generic and "JQuery" is not "jQuery".
Could you please check if you have node_modules/@types/jquery
folder?
I get the same error when I remove mine. That's why I added this dependency.
Yes. I have it for sure. I did "rm -rf node_modules; yarn install; yarn upgrade".
There is src/materialize.d.ts and JQuery is defined as an interface. It's not generic.
That's fine. There should be node_modules/@types/jquery
. Not sure if yarn downloads that... Please check if it's there.
I have node_modules/@types/jquery
and its contents.
If you intended to use jQuery rather than JQuery and to use @types/jquery
, we need
/// <reference path="../../node_modules/@types/jquery/index.d.ts" />
or something like that at somewhere in collapsible.ts, right?
You need a specific 'node_modules/@types/jQuery' package. Please confirm you have it installed. Also worth checking the demo app source - it's built with webpack and typescript.
On Tue., 3 Apr. 2018, 4:59 pm HIRANO Satoshi, notifications@github.com wrote:
I have node_modules/ and its contents.
If you intended to use jQuery rather than JQuery and to use , we need
///
or something like that at somewhere in collapsible.ts, right?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/aurelia-ui-toolkits/aurelia-materialize-bridge/issues/496#issuecomment-378148290, or mute the thread https://github.com/notifications/unsubscribe-auth/ADimvP8x4QzvTgMbCvhYj5pe5Ktl0yj4ks5tkx3PgaJpZM4TADUZ .
You are right. I had ^2.0 of @types/jquery
in my package.json.
Now I updated it to ^3.3.0 and the type error has been disappeared.
Thanks so much!
Hi, I think, since it has been converted to TS, we have the following errors.