Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
`readline` Regression since v24.2.0 `Cannot read properties of undefined (reading 'pause')` | GoodFirstPicks

`readline` Regression since v24.2.0 `Cannot read properties of undefined (reading 'pause')`

nodejs/node 2 comments 1mo ago
View on GitHub
lowopenScope: clearSkill match: maybeTest focusedNode.jsJavaScript

Why this is a good first issue

Regression bug with clear reproduction steps and proposed fix.

AI Summary

The issue is a regression in the `readline` module since Node v24.2.0, causing a crash when `this.input` is accessed before initialization. A fix involving reordering initialization and adding a regression test has been proposed, but the contributor faced network/build issues, leaving it for others to complete.

Issue 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
const readline = require('readline');
const {Readable} = require('stream');

const input = Readable.from([]);
input.onHistoryFileLoaded = () => 'oops';
readline.createInterface(input);
node ./readline-repro.js

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Prior to Node v24.2.0, this did not crash

What do you see instead?

node readline-repro.js
node:internal/readline/interface:571
    this.input.pause();
               ^

TypeError: Cannot read properties of undefined (reading 'pause')
    at Interface.pause (node:internal/readline/interface:571:16)
    at ReplHistory.initialize (node:internal/repl/history:111:20)
    at Interface.setupHistoryManager (node:internal/readline/interface:392:27)
    at Interface.InterfaceConstructor (node:internal/readline/interface:218:8)
    at new Interface (node:readline:115:3)
    at Object.createInterface (node:readline:212:10)
    at Object.<anonymous> (/private/tmp/readline-repro.js:6:21)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
    at Object..js (node:internal/modules/cjs/loader:1899:10)
    at Module.load (node:internal/modules/cjs/loader:1469:32)

Node.js v24.2.0

Additional information

The 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.

So a more real-world issue would be:

// readline-test.js
const readline = require('readline');
readline.createInterface(jest

GitHub Labels

readline

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • network/build issues for contributor
Loading labels...

Details

Points10 pts
Difficultylow
Scopeclear
Skill Matchmaybe
Test Focusedyes