Skip to content

This line broke typings in a project I help maintain: #12375

@Uzlopak

Description

@Uzlopak

This line broke typings in a project I help maintain:

toConstructor(): typeof this;

That project uses typescript 4.1.3, which is quite dated. When dependabot bumped mongoose from 6.2.0 to 6.5.4, CI broke with this error:

node_modules/mongoose/types/query.d.ts:619:29 - error TS2304: Cannot find name 'this'.

619     toConstructor(): typeof this;
                                ~~~~


Found 1 error.

error Command failed with exit code 2

I tried bumping typescript, but it was not very successful. Versions below 4.4 showed the same error and v4.4+ generated a lot of other errors, unrelated to the library. Most of them were to do with error becoming unknown instead of any in catch.

Not sure if this is actionable, but flagging the problem just in case.

Originally posted by @kachkaev in #12284 (comment)

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