Ts-node-dev: Running `repl.start` with ts-node-dev is unusable

Created on 31 Dec 2019  路  2Comments  路  Source: wclr/ts-node-dev

I run my my TypeScript app as follows:

$ ts-node-dev --transpileOnly --ignore-watch node_modules src/client.ts

src/client.ts is just as follows:

import * as process from 'process';
import * as repl from 'repl';

repl.start({ prompt: 'terminal> ' });

The REPL terminal becomes completely unusable. If I press Enter I get rl.on line. If I type a char, it's not written (just one of each 2 or 3 chars are written). I have to press Ctrl+C 4 times to exit the process, etc etc. 100% unusable.

This does not happen if I run my app without ts-node-dev.

Do I miss something? I see that, somehow, ts-node-dev opens a REPL by itself, but it's 100% unclear for me how to use it. Anyway, is there any way to disable such a REPL?

BTW, running with ts-node as follows the issue does not happen (I can use my REPL terminal perfectly):

$ ts-node src/client.ts

Most helpful comment

Ok, just found the command line argument to disable the built in readline in ts-node-dev:

--rs false

May be this could be documented in the README?

All 2 comments

Ok, just found the command line argument to disable the built in readline in ts-node-dev:

--rs false

May be this could be documented in the README?

Will add to docs.

Was this page helpful?
0 / 5 - 0 ratings