-
-
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
QueryCursor.js is throwing an error on line 144: "TypeError: Cannot assign to read only property 'map' of object '#<QueryCursor>'" #11377
Comments
Same happening to Temp fix: change your package.json engines line to this:
|
I can reproduce it on node 17.5. @IslandRhythms You dont need a repoductions script. Just And voila you get that issue. |
Opened ticket in nodejs bugtracker regarding this |
Is there any alternative for now? I am also using this in my project and its crashed now. |
Having the same issues as well. Any fix? |
You can change the node version to v14 and the error gets fixed for now. |
Thanks it worked. My application automatically updated the Node engine to 17.5 and didn't realize what was causing the issue. |
Thanks!! It worked |
@hemantvishwakarma
|
Add below under |
i did but showing same error |
Try 14.x instead of complete version |
same error i deployed code on digital ocean Kubernates |
Please check on digital ocean to see if there are other options to specify node version of the image they are using for kubernetes. |
This is not a kubernetes specific issue. Kubernetes is a docker orchestrator. So you have to modify your dockerfile to use a working node base image. Also I would recommend to you to not use odd major versions of node, as they are bleeding edge. Best practice is to use LTS-versions for production, to specifically avoid such issues, and those are node versions with even major-version (12, 14, 16...). If you use node:latest in your dockerfile, than you are using node 17.5, according to dockerhub. And thats why you have issues. Best practice for node docker images is to pinpoint exact versions down to patch-version. E.g. use |
I don't know if this is relevant for you, but I had the same problem right at the moment. Up and downgraded my node version. then i realized INSIDE my docker-container there is an other node version. It was defined by my Dockerfile with: So I changed it to: and now it is working! |
oh lol you already had the answer - I didn't realise while I wrote my comment 😅 |
Dont worry. How we Germans say: Doppelt hält besser. @hemantvishwakarma |
@Uzlopak |
Thanks @abeledovictor
|
guys, I used to have this:
and as per the advice here, changed it to:
and now it works!!! THANK YOU SO MUCH FOR ALL YOUR HELP, ESPECIALLY @Uzlopak |
Latest version 17.6.0 of node with the fix (nodejs/node#41931) is out : https://github.com/nodejs/node/releases/tag/v17.6.0 Not available in docker yet as :latest image still points to 1.17.5 but it should be available very soon. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
QueryCursor.js is throwing an error on line 144:
QueryCursor.prototype.map = function(fn) {
Trying to assign to read only property 'map' of object
If the current behavior is a bug, please provide the steps to reproduce.
This bug only arose when I upgrade Node.js to v17.5.0. I don't think I can easily provide a script to replicate.
What is the expected behavior?
QueryCursor.js should not throw an error.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Mongoose: 6.2.1
Node.js: 17.5.0
MongoDB: 4.4
The text was updated successfully, but these errors were encountered: