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

Suddenly started to get this error #11379

Closed
leobgm opened this issue Feb 11, 2022 · 5 comments
Closed

Suddenly started to get this error #11379

leobgm opened this issue Feb 11, 2022 · 5 comments

Comments

@leobgm
Copy link

leobgm commented Feb 11, 2022

/root/project/node_modules/mongoose/lib/cursor/QueryCursor.js:144
QueryCursor.prototype.map = function(fn) {
                          ^

TypeError: Cannot assign to read only property 'map' of object '#<QueryCursor>'
    at Object.<anonymous> (/root/project/node_modules/mongoose/lib/cursor/QueryCursor.js:144:27)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/root/project/node_modules/mongoose/lib/query.js:12:21)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)

Node.js v17.5.0

I'm using the last version of mongoose.

@faradaytrs
Copy link

Same here, problem on node 17.5.0

@Maximusya
Copy link

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md#2022-01-18-version-1740-current-targos:

[9f5a873965] - (SEMVER-MINOR) stream: add map method to Readable (Benjamin Gruenbaum, Robert Nagy) #40815

@Maximusya
Copy link

Ah, sorry, it duplicates #11377

@benjamingr
Copy link
Contributor

@Maximusya I actually broke this in another change due to spec compliance rather in the change adding map nodejs/node#41775

There is a revert PR open for Node and a Mongoose PR open to make mongoose still work with the tc39 iterator-helpers spec

@leobgm
Copy link
Author

leobgm commented Feb 14, 2022

Ah, sorry, it duplicates #11377

Yes this is the problem. Changing node version to latest LTS solved my problem. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants