Shiny runtime works inRStudio but cannot be deployed

I run a flexdashboard with shiny runtime.

"Run Document" works (produces working app).
"Publish" gives option to connect to RPubs and RStudio Connect.
I select RStudio Connect, and publish document only (no source code).
Then, I get an error message: "To publish finished document to RStudio Connect, you must first render it. Dismiss this message, click Knit to render the document, then try publishing again."
I have knit'ted the document, and get the same error message.

Running "deployApp()" uploads the app and opens the browser, but it produces the error: "An error has occurred. Check your logs or contact the app author for clarification."

There was a similar question for the same problem, in that case due to the use of a package. In this case, the only package used is data.table.

Question: how do I deploy a Shiny app on shinyapps.io?

Work environment:

R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

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

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

other attached packages:
[1] rsconnect_0.8.24 flexdashboard_0.5.2 rmarkdown_2.9 shiny_1.6.0