Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile with TypeScript #11512

Closed
burn2delete opened this issue Mar 10, 2022 · 6 comments · Fixed by #11513
Closed

Does not compile with TypeScript #11512

burn2delete opened this issue Mar 10, 2022 · 6 comments · Fixed by #11513
Labels
typescript Types or Types-test related issue / Pull Request

Comments

@burn2delete
Copy link

burn2delete commented Mar 10, 2022

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

Bug

What is the current behavior?

Unable to compile due to message Cannot find type definition file for 'mongoose/types/cursor'.

If the current behavior is a bug, please provide the steps to reproduce.
Try compiling with any typescript project.

What is the expected behavior?
Compiles without errors.

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

Mongoose: 6.2.5

Seems the types cursor file is of the wrong file extension. Needs to change from .ts to .d.ts

https://github.com/Automattic/mongoose/blob/master/types/cursor.ts

@burn2delete
Copy link
Author

As a follow up to this, it seems Typescript is still passing GitHub checks, those aren't currently working.

@bke-daniel
Copy link

bke-daniel commented Mar 10, 2022

I can confirm both, doesn't happen with 6.2.3

@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 10, 2022

I will have a look at it.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 10, 2022

Which version of typescript do you use and what is your tsconfig?

@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 10, 2022

I see it. I messed up with the filename. It should have been cursor.d.ts and not cursor.ts.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 10, 2022

In regard to avoid again such a regression I added in #11516 logic to validate that we only have .d.ts files in types folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants