Skip to content

Mongoose slows down performance of VSCode (TSServer) by a lot #10349

Closed
@ShadiestGoat

Description

@ShadiestGoat

Do you want to request a feature or report a bug?

bug

What is the current behavior?

It slows down vscode by a lot, even with small projects. I have a very small project, with like 2 small schemas, and the 2 other files, containing on average 160 lines of code, and vscode slows down a lot as soon as I install mongoose. This does not happen when I install most other libraries (haven't tested them all lmao). If I uninstall mongoose, it comes back and works perfectly normal.
To clarify "slowing down" means that typescript language server needs 3-5 seconds to realise that I'm importing somethign invalid, and just vscode in general to realise I'm importing something that's never used takes around 2-4 seconds. Usually it happens in under a second so like.. you know...
And it's not like vscode is taking a lot of ram/cpu either, it just grows slow.
Btw I think this is a mongoose issue, since it happens with no other library, its a special case here
Reloading typescript server or project doesn't help

If the current behavior is a bug, please provide the steps to reproduce.

Have vscode to edit your code
Install mongoose on your current project (npm i mongoose

My tsconfig.json:

{
    "compilerOptions": {
        "allowJs": true,
        "moduleResolution": "Node",
        "esModuleInterop": true,
        "target": "ES6",
        "resolveJsonModule": true,
        "outDir": "./dist",
        "checkJs": true,
        "module": "CommonJS",
        "lib": ["ESNext"]
    },
    "include": ["src"]
}

What is the expected behavior?

It to not be like this, lmao.

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.

Node: v16.2.0
Mongoose: 5.12.13
Linux: 5.12.7-arch1-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptTypes or Types-test related issue / Pull Request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions