-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
- Version: master
- Platform: Ubuntu 20.04
- Subsystem: repl
What steps will reproduce the bug?
'use strict';
const repl = require('repl');
const r = repl.start({ terminal: false });
r.setupHistory('/nonexistent/file', (err) => console.log(err));
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
No error (beyond the warning message)
What do you see instead?
$ node repltest.js
>
Error: Could not open history file.
REPL session history will not be persisted.
node:readline:794
StringPrototypeSlice(this.line, 0, this.cursor);
^
TypeError: String.prototype.slice called on null or undefined
at slice (<anonymous>)
at REPLServer.Interface.getCursorPos (node:readline:794:27)
at REPLServer.Interface._refreshLine (node:readline:419:26)
at _writeToOutput (node:internal/repl/history:30:8)
at oninit (node:internal/repl/history:69:7)
at FSReqCallback.oncomplete (node:fs:184:23)
at FSReqCallback.callbackTrampoline (node:internal/async_hooks:131:14)
Metadata
Metadata
Assignees
Labels
replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.