JavaSript General Signature mismatch Inspector showing weird error

On one of my projects I get the following text from the "JavaScript>General>Signature mismatch" Inspector:
"Argument type [Promise<MyClass>, Promise<MyOtherClass>] is not assignable to parameter type [(PromiseLike<MyClass> | MyClass), (PromiseLike<MyOtherClass> | MyOtherClass), (PromiseLike<any> | any), (PromiseLike<any> | any), ...this repeats several times...]"

The warning is shown on the Promise.all method. I call it like this:

Promise.all([ someFunction(), someOtherFunction()])...

someFunction returns a Promise that will resolve to an instance of MyClass.
someOtherFunction returns a Promise that will resolve to an instance of MyOtherClass.

I just don't see the error. Is that just me, or is there an error with the inspector?

Thank you very much for any help.

1
8 comments

Please provide a full, self-containing code snippet, including yoiur `somefunction` and `otherfunction` definitions

0
Avatar
Permanently deleted user

It get's weirder: The inspector does not show the error anymore. Seem's like a restart of PHPStorm solved it.

If I wouldn't have the appended screenshot, I wouldn't believe myself this ever happened.
Thank you very much for trying to help me.

0

>The inspector does not show the error anymore. Seem's like a restart of PHPStorm solved it.

Must be related to broken indexes; should the problem occur again, please try invalidating caches (File | Invalidate caches, Invalidate and restart)

0
Avatar
Permanently deleted user

Iv got almost the same problem with Promise.race:

 

Argument type [Promise<Response>, Promise<any>] is not assignable to parameter type [(PromiseLike<Response> | Response), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any), (PromiseLike<any> | any)] 

 

Invalidation and restart didn't help in my case.

0

Please provide a full, self-containing code snippet that can be used to recreate the issue. Also, what IDE version do you use?

0
Avatar
Permanently deleted user

> Also, what IDE version do you use?

WebStorm 2018.3.1 EAP
Build #WS-183.4588.29, built on November 29, 2018

> Please provide a full, self-containing code snippet that can be used to recreate the issue.

I have no idea why but in the same way as Matthias the error is not reported anymore.

0
Avatar
Permanently deleted user

>Must be related to broken indexes; should the problem occur again, please try invalidating caches (File | Invalidate caches, Invalidate and restart)

This seems to be the isse. I now restart the IDE much more frequently and have not seen weird errors like these since.
What PHPStorm especially doesn't seem to like is windows' "Sleep".
After a wake up of the system PHPStorm seems to always be very confused about itself and the opened projects.

0
Avatar
Permanently deleted user

Restarting IDE worked for me.

0

Please sign in to leave a comment.