firebase
firebase copied to clipboard
Example App does not render anything in Firefox, sometimes
The below works reliably in Chrome and Safari, but only intermittently Firefox. When it doesn't work, nothing is rendered in the Firefox browser.
library(shiny)
library(firebase)
ui <- fluidPage(
useFirebase(), # import dependencies,
firebaseUIContainer()
)
server <- function(input, output){
f <- FirebaseUI$
new()$ # instantiate
set_providers( # define providers
email = TRUE,
google = TRUE
)$
launch() # launch
}
shinyApp(ui, server)
The rendered HTML in Firefox (using view page source in Firefox) looks identical when it works and doesn't work. There are no errors in the Firefox console. Opening a new tab and pasting the locally generated URL (from Shiny, using RStudio) sometimes results in the expected Firebase login buttons, but sometimes does not. This appears to be a problem with how Firefox is rendering the JS or something else with Firefox (that is, the same Shiny instance sometimes works in Firefox, but sometimes doesn't).
Can you try
server <- function(input, output){
f <- FirebaseUI$
new()$ # instantiate
set_providers( # define providers
email = TRUE,
google = TRUE
)
observe({
launch() # launch
})
}
A couple notes:
-
I could reliably reproduce the problem with my example and restarting the R session before launching the app. It seems that something is likely cached on first load, which makes subsequent loads work as expected.
-
Your code, I presume, needs to have a "f$" in front of launch() inside the
observe()
. With that revision, as I've pasted below, it now seems to work as expected in Firefox -- reliably.
library(shiny)
library(firebase)
ui <- fluidPage(
useFirebase(), # import dependencies,
firebaseUIContainer()
)
server <- function(input, output){
f <- FirebaseUI$
new()$ # instantiate
set_providers( # define providers
email = TRUE,
google = TRUE
)
observe({
f$launch() # launch
})
}
shinyApp(ui, server)
Indeed. The real issue here is that I am still unsure what is happening.
This has been pointed out before, I have to change the documentation but have not found the time.