Webstorm not detecting await and response type when nested object

I tryed following case:

const SomeFunction = async () => {
const myObject = {};
myObject.test = {
async myFunc() {
return [];
},
};
const myArr = await myObject.test.myFunc();
myArr.filter(a => a);
};

When I have nested object, the type of the function response is not detected (e.g. array) that is why Webstorm show the filter function as unresolved. When I remove the await, the type of the function response is detected, but there is no missing await warning. Is this a bug or can it be fixed somehow? 

0
3 comments

Hello, It works for me in 2021.1. Could you please check this version: https://www.jetbrains.com/webstorm/nextversion/?

1

Oksana Chumak Thanks, that works by me. I will use this next version for now :) 

Elena Pogorelova The problem is in nesting+await, not only in the await

0

Please sign in to leave a comment.