posit-dev / r-shinylive

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

shinylive in netlify #34

Closed joscani closed 8 months ago

joscani commented 9 months ago

Hi. I'm a newbie in shinylive, I try to follow the example in https://posit-dev.github.io/r-shinylive/ after

shinylive::export("myapp", "site")

I push the site directory into my netlify site https://muestrear-no-es-pecado.netlify.app/ under the folder https://muestrear-no-es-pecado.netlify.app/shiny_site/ but I don't get anything. Any idea? . Thanks Note: It works if I render my quarto website in local. but not in netlifty

schloerke commented 9 months ago

Any console warnings in your browser? Or any Network tab failures in your developer window for the web page?

I wonder if it'll be related to cross-origin isolation from the host: https://github.com/posit-dev/shinylive/blob/c6fa4dd0c1ad17a6848d5e0a571ea7fccbdf9212/src/shinylive-sw.ts#L19C1-L25

georgestagg commented 9 months ago

I wonder if it'll be related to cross-origin isolation from the host: [...]

// Modify a response so that the required CORP/COOP/COEP headers are in place // for cross-origin isolation. Required when using webR.

That last sentence of the comment in the source is no longer true. We should remove it, webR can now run OK without the headers in place.

Judging from the network log, it looks like https://muestrear-no-es-pecado.netlify.app/shiny_site/shinylive/webr/R.bin.data is not found, throwing a 404 error. However, both R.bin.js and R.bin.wasm are downloaded OK.

I'm not sure how that could happen. Does the shinylive/webr/R.bin.data file exist in your site output on disk?

joscani commented 8 months ago

ups. I think the problem was my .gitignore file . Right now it works fine