Title: Regression in Node 17.5, Assigning a function to prototype of an Object results in a TypeError: Cannot assign to read only property 'x' of object 'y' at Object.
Open Graph Title: Regression in Node 17.5, Assigning a function to prototype of an Object results in a TypeError: Cannot assign to read only property 'x' of object 'y' at Object.
X Title: Regression in Node 17.5, Assigning a function to prototype of an Object results in a TypeError: Cannot assign to read only property 'x' of object 'y' at Object.
Description: Version 17.5 Platform Linux aras-Lenovo-Legion-5-17ARH05H 5.13.0-21-generic #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? We maintain the mongoose-proj...
Open Graph Description: Version 17.5 Platform Linux aras-Lenovo-Legion-5-17ARH05H 5.13.0-21-generic #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem No response What steps will reproduc...
X Description: Version 17.5 Platform Linux aras-Lenovo-Legion-5-17ARH05H 5.13.0-21-generic #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem No response What steps will reproduc...
Opengraph URL: https://github.com/nodejs/node/issues/41926
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression in Node 17.5, Assigning a function to prototype of an Object results in a TypeError: Cannot assign to read only property 'x' of object 'y' at Object.\u003canonymous>","articleBody":"### Version\n\n17.5\n\n### Platform\n\nLinux aras-Lenovo-Legion-5-17ARH05H 5.13.0-21-generic #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nWe maintain the mongoose-project. Devs reported that node 17.5 is throwing a TypeError when using the package. \r\nI tested it with node 17.5 and run the unit tests, and could reproduce the Error. When I test with node 17.4, there is no TypeError.\r\nI checked the Changelog and there is no remark regarding a breaking change, nor does the changes implicate a breaking change in nodes behaviour.\r\n\r\nSo I assume that there is a Regression in node 17.5.\r\n\r\nMaybe something with the attribute \"map\" is special? \r\n\r\nAlso is reported that adding \"engines\": { \"node\": \">=12.0.0 \u003c17.5.0\" }, to package.json fixes the issue.\r\nIs there some nodejs quirk mode? Do we have to change something in our codebase to not raise this Error?\r\n\r\nJust checkout mongoose-project, install dependencies, and run the tests under node 17.5\r\n\r\nSee also:\r\nhttps://github.com/Automattic/mongoose/issues/11377\r\n\r\n\n\n### How often does it reproduce? Is there a required condition?\n\nHappens always.\n\n### What is the expected behavior?\n\nShould not throw a TypeError like it did not throw in node \u003c= 17.4 and unit tests should pass as usual.\n\n### What do you see instead?\n\nWhen running the tests we get:\r\n\r\n```\r\nTypeError: Cannot assign to read only property 'map' of object '#\u003cQueryCursor>'\r\n at Object.\u003canonymous> (/home/aras/Workspace/mongoose/lib/cursor/QueryCursor.js:144:27)\r\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:999:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003canonymous> (/home/aras/Workspace/mongoose/lib/query.js:12:21)\r\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:999:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003canonymous> (/home/aras/Workspace/mongoose/lib/index.js:18:15)\r\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:999:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003canonymous> (/home/aras/Workspace/mongoose/index.js:9:18)\r\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:999:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003canonymous> (/home/aras/Workspace/mongoose/test/common.js:7:18)\r\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:999:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003canonymous> (/home/aras/Workspace/mongoose/test/aggregate.test.js:7:15)\r\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at ModuleWrap.\u003canonymous> (node:internal/modules/esm/translators:168:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:197:25)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:337:24)\r\n at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)\r\n at async formattedImport (/home/aras/Workspace/mongoose/node_modules/mocha/lib/nodejs/esm-utils.js:7:14)\r\n at async Object.exports.requireOrImport (/home/aras/Workspace/mongoose/node_modules/mocha/lib/nodejs/esm-utils.js:48:32)\r\n at async Object.exports.loadFilesAsync (/home/aras/Workspace/mongoose/node_modules/mocha/lib/nodejs/esm-utils.js:103:20)\r\n at async singleRun (/home/aras/Workspace/mongoose/node_modules/mocha/lib/cli/run-helpers.js:125:3)\r\n at async Object.exports.handler (/home/aras/Workspace/mongoose/node_modules/mocha/lib/cli/run.js:374:5)\r\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/Uzlopak","@type":"Person","name":"Uzlopak"},"datePublished":"2022-02-11T00:13:01Z","url":"https://github.com/nodejs/node/issues/41926"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4982778e-44df-73d0-3b01-b1b6f8ebfc3d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D73A:20C6D9:98B814:CAFA11:6AED2FB8 |
| html-safe-nonce | eabc55b5f1286c923fd4548948769c28df3d9d648e882bf4a978027375752f55 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzNBOjIwQzZEOTo5OEI4MTQ6Q0FGQTExOjZBRUQyRkI4IiwidmlzaXRvcl9pZCI6IjEyNDEwMzkxNjQyNzQ0NTQ0NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1be6c8979a72564fe139f23fbb28e4a1ee603bd4e13f2a7a36001441034b3ced |
| hovercard-subject-tag | issue:1131304519 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/41926/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec408c6612a5c91ef395749b2315e8fccb2243d9f8746b4cf63229699b3415d7/nodejs/node/issues/41926 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec408c6612a5c91ef395749b2315e8fccb2243d9f8746b4cf63229699b3415d7/nodejs/node/issues/41926 |
| og:image:alt | Version 17.5 Platform Linux aras-Lenovo-Legion-5-17ARH05H 5.13.0-21-generic #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem No response What steps will reproduc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Uzlopak |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width