Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shinymaterial app fails to run without internet connection #103

Open
fungs opened this issue Jan 3, 2020 · 5 comments
Open

Shinymaterial app fails to run without internet connection #103

fungs opened this issue Jan 3, 2020 · 5 comments

Comments

@fungs
Copy link

fungs commented Jan 3, 2020

It seems that the builtin theme in the current stable version pulls some Google fonts. Therefore, when loading the app while running it locally without internet access, the app fails complains with the sentence

ERROR: cannot open the connection to 'https://fonts.googleapis.com/icon?family=Material+Icons'

This is related to the default way to replace the default CSS in #97.

@ericrayanderson
Copy link
Owner

This code was unchanged in the update (L85 of shiny-material-page.R). Trying to determine the issue now.

@ericrayanderson
Copy link
Owner

material_page(include_icons = TRUE, ...) should load the files locally (without internet connection).

@fungs
Copy link
Author

fungs commented Jan 6, 2020

Thanks, @ericrayanderson, this seems to work. I see that it generates subfolder in the shiny web root called icons where it copies the font. This is totally ok for me.

I know that Google recommends to load fonts from the web, but from a regular developer point of view I would (totally) consider it bad design that general UI has run-time dependencies to a foreign web server, so I wouldn't make it a default (like I suppose regular shiny application do).

Also, there are some efforts to maintain and host the icons in an open way (Google's repo is currently unmaintained), in case you want to remove Google dependencies (I suppose they do some kind of tracking) or simply update the icon set:

@ericrayanderson
Copy link
Owner

Oh interesting, did not know about the open source hosting of the icons.

I updated a branch that hopefully resolves issue #97, as well.

@fungs
Copy link
Author

fungs commented Feb 7, 2020

Thanks for your efforts.

When I run a a shinymaterial app and try to serve the contained font this will not work if the www folder is read-only. Is there a way to deposit the fonts there before with a deterministic name?

Warning in file.copy(from = icon_file.i, to = "www/icons/materialicons/",  :
  problem copying /usr/local/lib/R/site-library/shinymaterial/icons/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2 to www/icons/materialicons/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants