faressoft / faressoft/terminalizer
"TypeError: Cannot read property 'join' of undefined" on sharing error
- Dominant language
- JavaScript
- Stars
- 16.2k
- Forks
- 519
- PR merge metrics
- No merged PRs in 30d
Description
I incorrectly attempted to share a recording with a description that included double quote characters. This resulted in the following error:
```
$ terminalizer share launch.yml
Please enter some details about your recording
? Title title
? Description ""
? Tags such as git,bash,game linux
/home/regis/venvs/node_modules/terminalizer/commands/share.js:201
return reject(body.errors.join('\n'));
^
TypeError: Cannot read property 'join' of undefined
```
This error is caused by the fact that `body` is a string, not an object. It is resolved by adding `body = JSON.parse(body);` at the beginning of the request callback. Would you like me to open a PR?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in commands/share.js at the request callback around line 201, where the code calls body.errors.join('\n'). Reproduce the sharing flow with a description containing double quotes and inspect the response type. Done means the response is handled as structured data and the same error no longer produces a TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100