Shiny app with bslib in docker container loads .css and .js files only after refresh of page

71 Views Asked by At

I have a shiny app hosted in a docker container. When I access the app (or force refresh the browser window), the stylesheets are not loaded and I see multiple errors in the console (see below). This lead me to believe that the css files are not (yet) generate from sass. In my local environment and the docker container running locally I do not see these errors.

Thus, it seems that bslib needs some time to compile the css files on each startup of the container. This makes using the container fairly cumbersome, as it basically forces the user to refresh the browser a few times to get all stylesheets loaded. After refreshing the page, all stylesheets are there.

What is the recommended way around this issue? Putting all locally generated .css and .js files into /www ? Or is there a more elegant solution?

GET https://[URL-REDACTED]/crosstalk-1.2.0/css/crosstalk.min.css net::ERR_ABORTED 404 (Not Found)
[URL-REDACTED]/:18 

Similar errors are there for:

htmltools-fill-0.5.6.1/fill.css
bslib-page_fillable-styles-0.5.1/page_fillable.css
bslib-accordion-styles-0.5.1/bslib-accordion-styles.min.css
selectize-0.12.4/selectize.css
bslib-sidebar-js-0.5.1/sidebar.min.js 
bs3compat-0.5.1/bs3compat.js
htmlwidgets-1.6.2/htmlwidgets.js
crosstalk-1.2.0/js/crosstalk.min.js
bs3compat-0.5.1/tabs.js
bootstrap-datepicker-js-1.9.0/js/bootstrap-datepicker.min.js
datatables-binding-0.30/datatables.js
selectize-0.12.4/selectize-plugin-a11y.min.js 
plotly.js:2 Uncaught ReferenceError: HTMLWidgets is not defined
0

There are 0 best solutions below