Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text to be written must be a length-one character vector

Tags:

r

shiny

htmltools

After installing the new version of shiny (1.4.0) package, I face a strange error message

> Warning: Error in writeImpl: Text to be written must be a length-one
> character vector   [No stack trace available]

I do not really understand what has been changed? And how to fix this issue?

Any idea would be highly appreciated!

The Trace looks as follows:

13: execCallbacks(timeoutSecs, all, loop$id)
12: force(expr)
11: with_loop(loop, invisible(execCallbacks(timeoutSecs, all, loop$id)))
10: run_now(timeoutMs/1000, all = FALSE)
9: service(timeout)
8: serviceApp()
7: ..stacktracefloor..(serviceApp())
6: withCallingHandlers(expr, error = doCaptureStack)
5: domain$wrapSync(expr)
4: promises::with_promise_domain(createStackTracePromiseDomain(), 
       expr)
3: captureStackTraces({
       while (!.globals$stopped) {
           ..stacktracefloor..(serviceApp())
       }
   })
2: ..stacktraceoff..(captureStackTraces({
       while (!.globals$stopped) {
           ..stacktracefloor..(serviceApp())
       }
   }))
1: runApp("Projects/Bomboleo")

No traceback available 
like image 325
And_R Avatar asked Oct 29 '19 13:10

And_R


2 Answers

One line in my codes is, c("text/csv","text/comma-separated-values,text/plain",".csv") It creates the same problem, because it passes the three text arguments.
Thus, I just rewrite it looking like c(".csv"), now it passes one text only! No more error now in my Shiny App!!

This error happens on UI part only.

like image 129
Gulam Sarwar Chuwdhury Avatar answered Sep 23 '22 21:09

Gulam Sarwar Chuwdhury


I had the same problem, but after playing around with removing the spaces behind some of the commas it finally worked for me! So my advise is to restructure your code, R probably doesn't recognize it due to some spaces at the end of a line of code

like image 43
Mudimans Avatar answered Sep 23 '22 21:09

Mudimans