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

Issue with carriage return/line feed #250

Closed
jsoules opened this issue Dec 4, 2024 · 0 comments · Fixed by #249
Closed

Issue with carriage return/line feed #250

jsoules opened this issue Dec 4, 2024 · 0 comments · Fixed by #249
Assignees
Labels
bug Something isn't working

Comments

@jsoules
Copy link
Collaborator

jsoules commented Dec 4, 2024

Reported on the Stan User Forums https://discourse.mc-stan.org/t/stan-playground-issues-with-pasting-scripts/37498

I was playing around with a simple model for a teaching demonstration and I noticed that if I paste code into the analysis/data script. I get the following errors:

If I paste the following R code into the data script

data <- list(
 n_samp = 60034,
 n_cont = 3255,
 n_samp_conv = 592,
 n_cont_conv = 27
)

and run it I get the following error:

Error: <text>:1:14: unexpected invalid token
1: data <- list(
                  ^
Error: [stan-playground] data must be a list
hL: Can't convert object of type null to string.

But if I delete all the code, save, and click “generate example”, delete the generated code and paste the original, I get no error.

The same is true for the analysis script, except the error encountered there is:

Error: <text>:30:33: unexpected invalid token
29: rm(.SP_DATA_IN)
30: attr(draws, 'dimnames')$variable

Again, if I click “generate example” first in the analysis script before pasting my code I don’t have an issue.

I was able to repeatedly replicate this on an incognito browser window using Microsoft Edge. I’d be using Chrome, but company policy to use Edge.

We suspect this is an issue with WebR interacting poorly with Windows-style CRLF line endings.

@WardBrian WardBrian linked a pull request Dec 4, 2024 that will close this issue
@jsoules jsoules added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants