Type issues with mongoose in webstorm

In the same piece of code, vscode's type hints are different from webstorm's type hints, but vscode's hints are right and webstorm's hints are wrong. Here is a screenshot of the code

vscode
 


webstorm
 


One is an object. The other is an instance. How do I solve this problem?

tsconfig:
 

0
3 comments

Can you please share a bit more context around the problem? Which version of the IDE are you using? Can you provide a file or a full, self-containing code snippet that would be sufficient to reproduce the problem?

-1

I'm using webstorm version 2024.1.6.

where the question file is defined as follows. In line 28 of it, eslint also reports an error. But vscode doesn't report an error. The error message is Unable to infer type from usage.

action
 

0

Please make sure that you have the Typescript language service enabled in Settings | Languages & Frameworks | TypeScript

0

Please sign in to leave a comment.