-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Mongoose 6.1.5 typescript build fail #11180
Comments
@imranbarbhuiya if you are using the latest version of @types/node try to downgrade to the v17.0.5, i had the same issue and this solution solves my problem |
I'm on Edit: My bad, I'm on |
@imranbarbhuiya so did that fix your issue? Was it being on a broken build that caused the problem? |
In my case, it's still failing in node v16 test node v17 test both are failing |
I checked your code and you did not fix the version of types/node you should delete the ^ before the version number |
I've changed it But still the build is failing |
Also failing for me on v6.1.5 but the issue is in the
|
@AndrewBarba R U sure this error is related to this issue? Also, for me, it was working in v6.1.5 even in @types/node v17.0.8 |
I had the same issue, when i use @types/node v17.0.5 the problem seems to be solved . ( PS: i am on node 14.18, typescript: 4.4.4 ) here after an issue opened on @types/node yesterday relating the same issue: |
@wejd I'm also on Node 14.18 and thus I use |
Mongoose 6.1.4 works in @types/node v17.0.8 and its not working in Mongoose 6.1.5 so I'm pretty sure the error is present in Mongoose and not @types/node. |
@imranbarbhuiya your build is now failing for a different reason:
It looks like this isn't tied to @types/node after all, sorry for the confusion. The easiest workaround is to pass the context to blogSchema.pre<Blog>('validate', function(next) { ... }) We'll take a look and see if we can work around this without causing significant perf overhead. I suspect the issue here is 1141ec4 . |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
My build is failing after updating mongoose to 6.1.5 but it was working fine in 6.1.4
If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/Codversity/Codversity/runs/4710880686?check_suite_focus=true
Here's the github action
https://github.com/Codversity/Codversity/blob/main/tsconfig.json
https://github.com/Codversity/Codversity/blob/main/tsconfig.server.json
What is the expected behavior?
It shouldn't break as it's a patch update.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node v16
Mongoose v6.1.5
The text was updated successfully, but these errors were encountered: