posit-dev / r-shinylive

https://posit-dev.github.io/r-shinylive/
Other
151 stars 16 forks source link

Host app on shared drive error #11

Closed Nilafhiosagam closed 11 months ago

Nilafhiosagam commented 11 months ago

Hi. I was interested in sharing an app within my company. We don't have a shiny server and the data is private so I thought shiny live would be perfect to create a html file on a share folder for people without any knowledge of r or programming in general to access. However it seems as though you cannot run it locally. Is their a workaround for this

index.html:1 Access to script at 'file:///PATHWHEREISHAREDTHEAPP/site/shinylive/load-shinylive-sw.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted. load-shinylive-sw.js:1 Failed to load resource: net::ERR_FAILED

chris31415926535 commented 11 months ago

Are you hosting the static app files from a web server, or just trying to load them from disk? In my brief testing, I get the same error as you only if I double-click the .html file and try to load it directly in a browser. If I use httpuv::runStaticServer("site/", port=8008) it works fine.

Nilafhiosagam commented 11 months ago

Are you hosting the static app files from a web server, or just trying to load them from disk? In my brief testing, I get the same error as you only if I double-click the .html file and try to load it directly in a browser. If I use httpuv::runStaticServer("site/", port=8008) it works fine.

I am trying to load from disk as my goal was to share an app with non tech savy people, however it seems like I would need to have a web server or I see other workarounds disabling flags in chrome. Unfortunately both difficult in my locked down organisation

schloerke commented 11 months ago

Due to technical limitations, it will not be possible to have it loaded from a local file.

The files must be hosted by something (GitHub pages, httpuv, S3, anything that hosts the files).

schloerke commented 11 months ago

Closing for now