Open sheerun opened 8 years ago
Can you print the whole stack and any additional related code?
I was unable to retrieve the stacktrace, but here's gist to reproduce the error:
https://gist.github.com/sheerun/474c852350c217fbdf0c9bd954ec7c3f
The command to run is npm install && docker-compose up
This only happens when enabling cli terminal with show()
command.
I needed to edit vorpal to catch the error. It's too bad you don't re-throw exceptions, but swallow them :(
web_1 | Vorpal Prompt error: TypeError: Cannot read property 'substring' of undefined
web_1 | at Interface.rl._getCursorPos (/app/node_modules/readline2/index.js:55:51)
web_1 | at ScreenManager.render (/app/node_modules/inquirer/lib/utils/screen-manager.js:19:27)
web_1 | at Prompt.render (/app/node_modules/inquirer/lib/prompts/input.js:75:15)
web_1 | at Prompt.inquirer.prompt.prompts.input.render (/app/node_modules/vorpal/lib/ui.js:78:23)
web_1 | at Prompt._run (/app/node_modules/inquirer/lib/prompts/input.js:49:8)
web_1 | at Prompt.run (/app/node_modules/inquirer/lib/prompts/base.js:57:8)
web_1 | at Object.<anonymous> (/app/node_modules/inquirer/lib/ui/prompt.js:83:12)
web_1 | at module.exports (/app/node_modules/run-async/index.js:15:21)
web_1 | at /app/node_modules/inquirer/lib/utils/utils.js:16:7
web_1 | at tryCatcher (/app/node_modules/rx-lite/rx.lite.js:537:29)
web_1 |
To be honest, it's hard to enable cli in docker-compose
, as it outputs logs and is not interactive, but I'd expect appropriate notification instead of such weird error.
Thanks. This is interesting - it's hitting some sort of conflict in Inqurier.js
. Will check out further.
var strBeforeCursor = this._prompt + this.line.substring(0, this.cursor);
this.line
is undefined in the readline2
module. Something like this usually happens when another module is already messing with readline
, and it creates conflicts. I'm not very familiar with docker-compose
, so I'll check out further.
Can you try to reproduce this with straight-up Vorpal and not Vantage? Wondering if its a version issue.
It happens only with vantage
Hmmm. Okay got it.
I get following error when running node app using vorpal with docker-compose.
I use following
docker-compose.yml
:dist/index.js
is just a simple script express server with vorpal attached. It works outside of docker.