swirldev / swirlify

:books: A toolbox for writing swirl courses
Other
63 stars 47 forks source link

Error when launching swirlify accompanied by incorrect colors and behavior in browser #5

Closed MaxGhenis closed 10 years ago

MaxGhenis commented 10 years ago

The below error happened for me when launching swirlify. The shiny UI still partially worked in that I could edit the description, but the colors went wonky and I was unable to add a new question (selecting the question type or clicking any of the buttons didn't do anything). Screenshot below error.

R> library(swirlify) R> swirlify("Subsetting data with data.table", "data.table")

Creating lesson directory:

/usr/local/google/home/mghenis/data.table/Subsetting_data_with_data.table Loading required package: shiny

Listening on http://127.0.0.1:3474 Shiny URLs starting with /shinyAce will mapped to /usr/local/google/home/mghenis/R/x86_64-pc-linux-gnu-library/3.0/shinyAce/www Error in FUN(X[[2L]], ...) : No method for converting htmlcharacter to JSON

screenshot from 2014-05-09 16 59 04

ncarchedi commented 10 years ago

Did you already have shiny installed? You may need to update it.

MaxGhenis commented 10 years ago

Verified I have the latest version of shiny. Also tried names not including periods, but problem persisted.

On Fri, May 9, 2014 at 5:17 PM, Nick Carchedi notifications@github.comwrote:

Did you already have shiny installed? You may need to update it.

— Reply to this email directly or view it on GitHubhttps://github.com/swirldev/swirlify/issues/5#issuecomment-42725837 .

ncarchedi commented 10 years ago

On my phone at the moment. Let me think and get back you when at my computer again.

ncarchedi commented 10 years ago

Would you mind providing the output from the following?

library(swirlify)
sessionInfo()
MaxGhenis commented 10 years ago

R> library(swirlify) Loading required package: swirl

| Hi! I see that you have some variables saved in your workspace. To keep | things running smoothly, I recommend you clean up before starting swirl.

| Type ls() to see a list of the variables in your workspace. Then, type | rm(list=ls()) to clear your workspace.

| Type swirl() when you are ready to begin.

R> sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-pc-linux-gnu (64-bit)

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] datasets utils stats graphics grDevices methods base

other attached packages: [1] swirlify_0.1 swirl_2.2.5 data.table_1.9.2 MASS_7.3-29 [5] reshape2_1.2.1 stringr_0.6.2 plyr_1.8

loaded via a namespace (and not attached): [1] bitops_1.0-5 caTools_1.14 digest_0.6.4 httpuv_1.3.0 httr_0.2

[6] Rcpp_0.11.1 RCurl_1.95-4.1 RJSONIO_0.96-0 shiny_0.9.1 shinyAce_0.1.0 [11] testthat_0.8.1 tools_3.0.2 whisker_0.3-2 xtable_1.5-6 yaml_2.1.11 R>

On Fri, May 9, 2014 at 6:21 PM, Nick Carchedi notifications@github.comwrote:

Would you mind providing the output from the following?

library(swirlify) sessionInfo()

— Reply to this email directly or view it on GitHubhttps://github.com/swirldev/swirlify/issues/5#issuecomment-42727736 .

ncarchedi commented 10 years ago

Thanks. Here's mine:

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] swirlify_0.1 swirl_2.2.5 

loaded via a namespace (and not attached):
 [1] bitops_1.0-6    caTools_1.17    digest_0.6.4    httpuv_1.3.0   
 [5] httr_0.3        Rcpp_0.11.1     RCurl_1.95-4.1  RJSONIO_1.2-0.2
 [9] shiny_0.9.1     shinyAce_0.1.0  stringr_0.6.2   testthat_0.8.1 
[13] tools_3.1.0     whisker_0.3-2   xtable_1.7-3    yaml_2.1.11  

You got an error No method for converting htmlcharacter to JSON, which is what caused the shiny app to appear darkened in color. It broke immediately. One thing I'm noticing is that I have a newer version of the RJSONIO package. Since your error is related to JSON, it might be worth updating that package to see if it fixes the problem. Unless you're concerned about screwing up any dependencies, it may be good to just run update.packages(ask=FALSE) to update everything.

One other thought. If possible, right after you get the error in the console, type traceback() and let me know if you get anything useful. I don't know if it will work in this scenario, but if we could see that output, it would give us a hint. Otherwise, if you're comfortable with R's debugging features, you could debug(swirlify) and step through the code to see where it breaks down.

Let me know if you can think of anything else. swirlify is a very simple package, so I'm a bit baffled that it's not working for you. Thank you for your patience.

MaxGhenis commented 10 years ago

Thanks, updating RJSONIO did the trick.

ncarchedi commented 10 years ago

Wow, what a pain. Glad we figured it out.

ncarchedi commented 10 years ago

By the way, I added RJSONIO to Imports with a version constraint, which will automatically upgrade an old version when someone installs swirlify.

https://github.com/swirldev/swirlify/blob/master/DESCRIPTION