Title: `readline` Regression since v24.2.0 `Cannot read properties of undefined (reading 'pause')` · Issue #61526 · nodejs/node · GitHub
Open Graph Title: `readline` Regression since v24.2.0 `Cannot read properties of undefined (reading 'pause')` · Issue #61526 · nodejs/node
X Title: `readline` Regression since v24.2.0 `Cannot read properties of undefined (reading 'pause')` · Issue #61526 · nodejs/node
Description: Version v24.13.0 Platform Darwin robhogan-mac 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64 Subsystem readline What steps will reproduce the bug? // readline-repro.js c...
Open Graph Description: Version v24.13.0 Platform Darwin robhogan-mac 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64 Subsystem readline What steps will r...
X Description: Version v24.13.0 Platform Darwin robhogan-mac 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64 Subsystem readline What steps will r...
Opengraph URL: https://github.com/nodejs/node/issues/61526
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`readline` Regression since v24.2.0 `Cannot read properties of undefined (reading 'pause')`","articleBody":"### Version\n\nv24.13.0\n\n### Platform\n\n```text\nDarwin robhogan-mac 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64\n```\n\n### Subsystem\n\nreadline\n\n### What steps will reproduce the bug?\n\n```js\n// readline-repro.js\nconst readline = require('readline');\nconst {Readable} = require('stream');\n\nconst input = Readable.from([]);\ninput.onHistoryFileLoaded = () => 'oops';\nreadline.createInterface(input);\n```\n\n```sh\nnode ./readline-repro.js\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nPrior to Node v24.2.0, this did not crash\n\n### What do you see instead?\n\n```\nnode readline-repro.js\nnode:internal/readline/interface:571\n this.input.pause();\n ^\n\nTypeError: Cannot read properties of undefined (reading 'pause')\n at Interface.pause (node:internal/readline/interface:571:16)\n at ReplHistory.initialize (node:internal/repl/history:111:20)\n at Interface.setupHistoryManager (node:internal/readline/interface:392:27)\n at Interface.InterfaceConstructor (node:internal/readline/interface:218:8)\n at new Interface (node:readline:115:3)\n at Object.createInterface (node:readline:212:10)\n at Object.\u003canonymous> (/private/tmp/readline-repro.js:6:21)\n at Module._compile (node:internal/modules/cjs/loader:1734:14)\n at Object..js (node:internal/modules/cjs/loader:1899:10)\n at Module.load (node:internal/modules/cjs/loader:1469:32)\n\nNode.js v24.2.0\n```\n\n### Additional information\n\nThe example is contrived (what are we doing assigning `onHistoryFileLoaded` anyway?) but we hit this in the wild in a Node.js update when passing `jest.mock()` as the `input`. Rightly or wrongly, `jest-mock` by default uses a proxy object to create properties as mock functions on access.\n\nSo a more real-world issue would be:\n\n```js\n// readline-test.js\nconst readline = require('readline');\nreadline.createInterface(jest.mock());\n```\nNow crashes.\n\nI root caused this to https://github.com/nodejs/node/pull/58225. Repeating here:\n\n`setupHistoryManager` is called within `InterfaceConstructor`, here:\nhttps://github.com/nodejs/node/blob/644ba1f7e6cc67d9b68083897abd7b602a3c548f/lib/internal/readline/interface.js#L218\n\nNote that's **before** `this.input` is assigned, here:\nhttps://github.com/nodejs/node/blob/644ba1f7e6cc67d9b68083897abd7b602a3c548f/lib/internal/readline/interface.js#L236\n\nWhich is a problem because `setupHistoryManager` may call `initialize()`\nhttps://github.com/nodejs/node/blob/644ba1f7e6cc67d9b68083897abd7b602a3c548f/lib/internal/readline/interface.js#L384-L389\n\nWhich tries to call `.pause()` on the interface's `input` property (still before it has been assigned)\nhttps://github.com/nodejs/node/blob/644ba1f7e6cc67d9b68083897abd7b602a3c548f/lib/internal/repl/history.js#L111\n\nCC @puskin ","author":{"url":"https://github.com/robhogan","@type":"Person","name":"robhogan"},"datePublished":"2026-01-26T12:20:02Z","url":"https://github.com/nodejs/node/issues/61526"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:8ba4ff64-ff5c-1bd8-6d67-5b93d04b1072 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C3C4:CC1A4:3009866:3D1CA57:6B01C48E |
| html-safe-nonce | ffefa666f92a7c5fbdfba6f01de91d8972329c159476f63be7b8509a042d2a97 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0M0OkNDMUE0OjMwMDk4NjY6M0QxQ0E1Nzo2QjAxQzQ4RSIsInZpc2l0b3JfaWQiOiIzMzYwMjQ5OTU3Mzk0MjY5MzI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5bc6bdd96536f50b670deafbc95b96bf082cfe8dfb50a8aa8c4f2060e41baae2 |
| hovercard-subject-tag | issue:3855735978 |
| 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/61526/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e5e8f4491c5792a92d63eed7e4d71418c98e0654265edf6f4279cb834cd2540d/nodejs/node/issues/61526 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e5e8f4491c5792a92d63eed7e4d71418c98e0654265edf6f4279cb834cd2540d/nodejs/node/issues/61526 |
| og:image:alt | Version v24.13.0 Platform Darwin robhogan-mac 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64 Subsystem readline What steps will r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robhogan |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width