Plotly and Leaflet fail on netlify #551
Replies: 1 comment
-
I have contacted netlify and their support and the support engineer says:
So I deleted it, commit, push, deploy... no change. The support engineer says:
At this point I am out of my depth - I may have to just use static images (.png) or go back to Hugo-Learn Can anyone help me with getting Plotly or Leaflet to work in Doks on Netlify (or another provider)? I'd really like to get it to work if possible! |
Beta Was this translation helpful? Give feedback.
-
Hello everyone. I am an R user migrating from Hugo-Learn. I am attempting to use Leaflet and Plotly widgets deployed on netlify.
Doks differs in detail from Learn in terms of integration with R - using Learn one can write R-markdown, 'publish site' in Rstudio, and avoid writing any html.
I have however simply followed https://stackoverflow.com/questions/61064701/how-do-i-insert-an-html-leafletmap-into-a-blog-post-hugo-website I place the html generated in R in a leaf bundle and use iframe in the markdown of a blog post.
leaflet
<iframe seamless src="leafmap/index.html" width="100%" height="500"></iframe>
plotly
<iframe seamless src="plotly/index.html" width="100%" height="500"></iframe>
This works just fine locally. However when deployed on netlify the error message is "anestuk-doksf.netlify.app refused to connect"
I have referred to #461 "Plotly Chart doesn't render" and made the change to ./layouts/index.headers as suggested by Henk.
My index.headers CSP line accordingly looks like this:
Content-Security-Policy: default-src 'self'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self' https://*.netlify.app; connect-src 'self' https://*.netlify.app; font-src 'self' https://*.netlify.app; img-src 'self' https://*.netlify.app data:; script-src 'self' https://cdn.plot.ly/plotly-latest.min.js; style-src 'self' https://*.netlify.app 'unsafe-inline'
However the error message remains, and the issue also remains with leaflet.
github: https://github.com/amberalpha/doksf is a minimal edit on the current doks starter theme, adding one blog post with widgets
on netlify autodeployed from github: https://anestuk-doksf.netlify.app/blog/widgets/
Any help very gratefully received!
Beta Was this translation helpful? Give feedback.
All reactions