-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Doesn't work in {shinylive} #88
Comments
@gadenbuie do you have any insights on why this package doesn't seem to work with shinylive? Simple reprex (shinylive.io link): library(shiny)
library(shinyalert)
ui <- fluidPage(
actionButton("preview", "Preview")
)
server <- function(input, output, session) {
observeEvent(input$preview, {
shinyalert("test")
})
}
shinyApp(ui, server) |
It seems that something is going wrong with the dependency resolution. Here are my notes in investigating this so far. In the example app above, shinyalert's HTML dependencies are added to the page with an Line 279 in b632e61
If you include library(shiny)
library(shinyalert)
ui <- fluidPage(
# useShinyalert(force=TRUE), #<< uncomment to get working
actionButton("preview", "Preview")
)
server <- function(input, output, session) {
observeEvent(input$preview, {
shinyalert("test")
})
}
shinyApp(ui, server) In app I just linked, on shinylive I turned on tracing, where you can see the insertUI message:
Locally, this message is
Which is clearly quite different. I'm going to ask around to see if shinylive does something special with html dependencies. |
Ah! The reason the messages are different is because the shinyalert package versions are different. https://shinylive.io currently has shinyalert 3.0.0, which used a different method for attaching html dependencies that doesn't work on shinylive. We'll be releasing a shinylive update soon, which will include an update for CRAN packages, at which point the latest version of shinyalert will work on shinylive.io |
Yep you're right that the newest CRAN version is using the better |
I just noticed the warning message I get from shinylive:
So I suppose I'm not getting it to work locally because I'm not actually using the latest shinyalert version. I don't understand why webassembly is using shinyalert v3.0.0 though, because https://repo.r-wasm.org/ says it has version 3.1.0 - is there a way for me to update that? |
shinylive is still using R 4.3 for now until the next release of shinylive (will be out soon). At the moment, the r-wasm repo doesn't update older versions of R, so shinyalert is up-to-date in R 4.4 but out-of-date in the R 4.3 repo. |
Got it. So you also could not get it to work as of right now, correct? |
posit-dev/r-shinylive#86
The text was updated successfully, but these errors were encountered: