prompts icon indicating copy to clipboard operation
prompts copied to clipboard

Select crashing in VsCode + Git Bash: Cannot read properties of undefined (reading 'split')

Open nvuillam opened this issue 1 year ago • 2 comments

Describe the bug

When using select, strage crash, and unable to leave script (any key pressed displays again the same error )

 🦙 Hit ENTER when done (or if previously done on the same repository) » - Use arrow-keys. Return to submit.
>   ☑ Yes
    ☓ No
    ⛔ Exit this script
TypeError: Cannot read properties of undefined (reading 'split')
    at module.exports (C:\Users\33614\AppData\Local\sfdx\node_modules\prompts\lib\util\clear.js:16:24)
    at SelectPrompt.render (C:\Users\33614\AppData\Local\sfdx\node_modules\prompts\lib\elements\select.js:123:25)
    at SelectPrompt.down (C:\Users\33614\AppData\Local\sfdx\node_modules\prompts\lib\elements\select.js:104:10)
    at ReadStream.keypress (C:\Users\33614\AppData\Local\sfdx\node_modules\prompts\lib\elements\prompt.js:32:16)
    at ReadStream.emit (node:events:525:35)
    at emitKeys (node:internal/readline/utils:357:14)
    at emitKeys.next (<anonymous>)
    at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)
    at ReadStream.emit (node:events:525:35)
    at addChunk (node:internal/streams/readable:324:12)

Is there a workaround ?

Expected behavior

No crash :/

System

  • OS: Windows 11
  • Terminal: Git bash in VsCode , and also standalone git bash
  • Node version: 18.12.0

nvuillam avatar Jan 29 '23 10:01 nvuillam

+1 same error

herenickname avatar Mar 13 '23 22:03 herenickname

@herenickname I migrated to inquirer and now all is ok :)

nvuillam avatar Mar 14 '23 06:03 nvuillam