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
An issue with types on mongoose v5 #165
Comments
@LosTigeros Please use below version for Mongoose 5. Let me know if this helps. |
@aravindnc that link isn't working. What's the specific version to use? |
@jdhiro This seems to be the latest one. Can you try it. |
After installing it, I'm getting a lot of these:
So this is not a solution |
You need to install old version of the plugin to work.
https://www.npmjs.com/package/mongoose-paginate-v2/v/1.5.0
Try above version or below for the time being.
Regards,Aravind NC
On Friday, 29 April, 2022, 11:52:51 am IST, Patryk L. ***@***.***> wrote:
After installing it, I'm getting a lot of these:
error TS2717: Subsequent property declarations must have the same type.
error TS2374: Duplicate index signature for type 'string'.
error TS2300: Duplicate identifier 'PaginateDocument'.
So this is not a solution
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I created that issue because I wanted to use the latest version of this package. It doesn't say anywhere that >= 1.6.0 is not compatible with v5 anymore. If this issue won't be fixed, please at least state somewhere that, mongoose-paginate-v2 >=1.6.0 is not compatible with legacy version of mongoose (v5). |
I had put off upgrading to the latest version of mongoose, and hence this library, because I was getting a ton of type errors when trying to update... Until I realized that my @types/node was @10 instead of @16. Updating that one thing got rid of almost all of my type errors with both Mongoose and this package. YMMV. |
Thanks for pointing this out.
There is a writeup already in the readme section.
Prior to version 1.5.0, types need to be installed from DefinitelyTyped.
But, we are not sure how the ts version got removed from DefinitelyTyped which caused the issue.
I will try some alternative for supporting mongoose v5.
On Friday, 29 April, 2022, 01:50:37 pm IST, Patryk L. ***@***.***> wrote:
I created that issue because I wanted to use the latest version of this package. It doesn't say anywhere that >= 1.6.0 is not compatible with v5 anymore. If this issue won't be fixed, please at least state somewhere that, mongoose-paginate-v2 >=1.6.0 is not compatible with legacy version of mongoose (v5).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This can avoid the build error but I don't think that's a solution. |
Please reopen if the issue exists. |
Describe the bug
Hey, that's not really a bug, but some type errors. To be exact, these:
To Reproduce
mongoose
(latest is 5.13.14) and latest version ofmongoose-paginate-v2
:yarn add [email protected] mongoose-paginate-v2
mongoose
andmongoose-paginate-v2
:index.ts
:> tsc .\index.ts
Expected behavior
TSC should transpile the file without returning any type errors.
Screenshots
Desktop (please complete the following information):
Not needed
Smartphone (please complete the following information):
Not needed
Additional context
If it helps you with anything, I'm using
yarn
instead ofnpm
.The text was updated successfully, but these errors were encountered: