App launching error disappeared with new R session.

466 views
Skip to first unread message

xhd...@umd.edu

unread,
Mar 10, 2017, 8:55:15 AM3/10/17
to Shiny - Web Framework for R
When I'm developing my Shiny app in RStudio, it became more and more often I met this error after launching the app:

> runApp('shiny/app')

Warning: Error in <Anonymous>: unable to find an inherited method for function ‘span’ for signature ‘"shiny.tag"’
Stack trace (innermost first):
    74: <Anonymous>
    73: span
    72: isTRUE
    71: is.singleton
    70: func
    69: rewriteTags
    68: takeSingletons
    67: processDeps
    66: showNotification
    65: observeEventHandler [/Users/xhdong/Projects/ctmm-Shiny/shiny/app/server.R#104]
     1: runApp
ERROR: [on_request_read] connection reset by peer

Then if I restart the R session the error will disappear:

> shiny::runApp('shiny/app')
Loading required package: shiny
Loading required package: pacman


Looks like previously Shiny is not even loaded. I checked RStudio logs but didn't find anything related.

Joe Cheng

unread,
Mar 10, 2017, 9:11:34 PM3/10/17
to xhd...@umd.edu, Shiny - Web Framework for R
This looks like a function name collision--like another package you've attached has a function named "span". When this happens, use ?span to see what other package you're using has such a function (besides htmltools and shiny). You should be able to work around this by explicitly using shiny::span() or htmltools::span() instead of just span().

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/31342f8c-26cb-488c-a61c-bb7e3029c013%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xhd...@umd.edu

unread,
Mar 13, 2017, 9:23:07 AM3/13/17
to Shiny - Web Framework for R
That was also my first guess. I have a RStudio addin to search all functions, symbols in all packages installed. So I fired it up and checked with "span". You can see from the attachment that only libraries with "span" is htmltools, shiny and geoshpere. I tried to load library of "geosphere" first then launch the app, but there was no error. 

When I first met the problem, the error message indicated that problem was with this line:

showNotification(span(icon("spinner fa-spin"), "Importing data..."), type = "message", duration = NULL)

I changed "span" into "tags$span". Then when the problem appear again, it was about a second occurrence of similar usage:

showNotification(span(icon("spinner fa-spin"), "Downloading studies..."), type = "message", duration = NULL)

So it definitely was caused by naming conflict with "span", but I'm not sure which package caused that, since I have searched all my packages. And I believe there is no variable named "span" in my global environment.

Anyway, the problem should be solved with using full qualified name. Thanks!

xhd...@umd.edu

unread,
Mar 13, 2017, 9:25:53 AM3/13/17
to Shiny - Web Framework for R
Uploading attachment seemed always cause problem, here is the screen shot I wanted to upload:
Reply all
Reply to author
Forward
0 new messages