REditorSupport / REditorSupport/vscode-R

Run command in Terminal errors with "Cannot read properties of undefined (reading 'replace')"

Open
#1,530 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug
Unable to run any code / file in R terminal.
Always getting an error dialog:

Command 'R: Run Command in Terminal' resulted in an error
Cannot read properties of undefined (reading 'split')

or when executing "R: Run command with editor path in terminal"

** Command 'R: Run Command With Editor Path in Terminal' resulted in an error**
Cannot read properties of undefined (reading 'replace')

To Reproduce
Steps to reproduce the behavior:

  1. Install R via homebrew brew install r
  2. Install R extension from REditorSupport
  3. Open R file
  4. Execute "R: Create R terminal"
  5. Execute "R: Run command in terminal"

Can you fix this issue by yourself? (We appreciate the help)

No

setting.json

// R path for Mac OS X
"r.rpath.mac": "/opt/homebrew/bin/R",

Expected behavior
Program is run in R terminal.

Screenshots
If applicable, add screenshots to help explain your problem.
You can show the keyboard contents by pressing F1 and Developer: toggle screencast mode

Environment (please complete the following information):

  • OS: macOS 14.4
  • VSCode Version: 1.89.1
  • R Version: 4.4.0
  • vscode-R version: 2.8.4

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure on macOS using the listed R commands, the r.rpath.mac setting, and the reported VS Code and extension versions. Trace the command entry points for "R: Run Command in Terminal" and "R: Run Command With Editor Path in Terminal"; done means both commands run code successfully in the R terminal without an error dialog.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.