Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function definition in Sweave-file causes error in RStudio #14646

Closed
5 of 6 tasks
protonenfalter opened this issue May 3, 2024 · 14 comments
Closed
5 of 6 tasks

Function definition in Sweave-file causes error in RStudio #14646

protonenfalter opened this issue May 3, 2024 · 14 comments

Comments

@protonenfalter
Copy link

protonenfalter commented May 3, 2024

Verify fixed in:

  • Patch: 2024.04.2
  • Release: 2024.07.0

System details

RStudio Edition : Desktop
RStudio Version : 2024.04.0+735
OS Version      :   Debian GNU/Linux 12 (bookworm)   and Ubuntu 22.04
R Version       : 4.4.0 (2024-04-24)

Steps to reproduce the problem

Save this minimal example as 'test.rnw' and open the file in RStudio:

simpletest.txt

Alternatively paste the text in a new empty file in RStudio and save the file as 'test.rnw'.

IMPORTANT: There is no issue if the file is opened / edited as ordinary .txt file! Only if the file is designated as of type Sweave (file ending .rnw) the described problems occur!

Describe the problem in detail

When opening the file RStudio throws an error:

(Type Error): Cannot read properties of undefined (reading 'count')

No file is opened.

When saving the text example as .rnw, the file viewer shows garbage / blank space and the file can no longer be edited.

NOTE: With larger Sweave-files containing similar function definitions, RStudio might completely crash!

Describe the behavior you expected

File should open/save properly and can be further worked on.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@protonenfalter protonenfalter added bug new New incoming issues, ready for initial review. labels May 3, 2024
@ronblum
Copy link
Contributor

ronblum commented May 3, 2024

@protonenfalter Thank you for raising the issue! I'm seeing similar issues when pasting in a Sweave file, on Windows 11 with RStudio Desktop 2024.04.0+735, but it works in 2023.12.1+402. This includes not being able to close files, and sometimes I can't close RStudio--I need to use the task manager. I tried a few other file types, but haven't found any others with a similar issue.

@ronblum ronblum added regression sweave and removed new New incoming issues, ready for initial review. labels May 3, 2024
@protonenfalter
Copy link
Author

Indeed. This seems to be a regression. On my platforms RStudio 2023.12.1+402 also works fine with the example given above.

@tophee
Copy link

tophee commented May 6, 2024

When opening the file RStudio throws an error:

(Type Error): Cannot read properties of undefined (reading 'count')

No file is opened.

I can confirm that this issue also exists on MacOS 14.4.1

@ronblum
Copy link
Contributor

ronblum commented May 6, 2024

@brry has a minimal example of creating a file with the following code, and then trying to open the file. The brackets are the offenders.

<<>>=
a={}
@

@jssanhueza
Copy link

Descargue la versión RStudio-2024.04.1-748 y sigue el mismo problema de los {} en rsweave. Alguien sabe cuando se arreglará?

@ronblum
Copy link
Contributor

ronblum commented May 14, 2024

@jssanhueza Aún no tenemos una solución para esto, pero estamos trabajando en ello. Lamentablemente todavía no tengo un horario para ello.

(I used Google Translate. Original: We don't have a solution for this yet, but we are working on it. Unfortunately I don't have a schedule for it yet.)

@ronblum
Copy link
Contributor

ronblum commented May 14, 2024

Ref: Support ticket 105091.

@kevinushey kevinushey self-assigned this May 14, 2024
@lachlansimpson
Copy link

lachlansimpson commented May 15, 2024

@ronblum
Copy link
Contributor

ronblum commented May 16, 2024

This is fixed in the latest dailies of the release that we're currently working on. You can get a daily build from https://dailies.rstudio.com/ if you'd like to checking it out. Please note that the dailies are meant for testing purposes only, not production.

@ronblum
Copy link
Contributor

ronblum commented May 16, 2024

QA note: Verified in RStudio Desktop 2024.07.0-daily+133 on Windows 11.

@ronblum ronblum closed this as completed May 16, 2024
@lachlansimpson
Copy link

Seen in ticket ZD # 105499

@ronblum
Copy link
Contributor

ronblum commented May 29, 2024

Update: We have a fix for this in an upcoming patch. You can get a development version of patch 2024.04.2 at https://dailies.rstudio.com/rstudio/chocolate-cosmos/. Please note that these builds are for testing purposes only, not production.

@ronblum
Copy link
Contributor

ronblum commented May 29, 2024

Verified in RStudio Desktop 2024.04.2+761 on Windows 11.

See automated tests: https://github.com/rstudio/rstudio-ide-automation/pull/1949

@ronblum ronblum self-assigned this May 29, 2024
@ronblum
Copy link
Contributor

ronblum commented May 29, 2024

Verified in RStudio Desktop 2024.07.0-daily+174 on Windows 11 using the same tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants