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

Occasional CORS loading issue on domtoimage + Leaflet + Stamen (toner-lite) #158

Open
MSCAU opened this issue Aug 12, 2020 · 7 comments
Open

Comments

@MSCAU
Copy link

MSCAU commented Aug 12, 2020

After having seen CORS errors for the last few days when loading Stamen tiles via domtoimage and Leaflet, inexplicably those errors had disappeared for most of today. They are now back (the last 30 mins). I can't imagine what else it could be. Are you people modifying the CORS settings at the moment?

@MSCAU
Copy link
Author

MSCAU commented Aug 13, 2020

FWIW, I am not getting CORS errors for the last 24 hours. Hooray.

@MSCAU
Copy link
Author

MSCAU commented Nov 17, 2020

Hmm. Am now getting these errors again for the last few weeks but only in Chrome 86.0.4240.198 (Official Build) (64-bit), not in Firefox 82.0.3 (64-bit).

To be clear, the tiles load initially (via Leaflet), but then fail to load in Chrome (and Edge) when requested a second time through domtoimage.

@MSCAU
Copy link
Author

MSCAU commented Nov 23, 2020

Somewhat surprised to find these errors have now disappeared in Chrome and Edge. Although I have just updated Chrome to the latest version 86.0.4280.66 (Windows 10), and initially thought that may have fixed it, I see that the problem has also disappeared from Edge, despite the fact that this hadn't been updated since last week.

Issue persists in Chrome 86.0.4280.67 (Mac) and Safari, though. It looked like a browser issue, but now it seems it may not be...

@ptkz
Copy link

ptkz commented Feb 8, 2022

Same issue here, but getting the error for only a single image:
https://stamen-tiles.a.ssl.fastly.net/toner-lite/3/3/3.png
Issue can be reproduced both in Chrome 98.0.4758.82 and Edge 98.0.1108.43

@MSCAU Have you found any workarounds?

@chlumpchatkupt
Copy link

Just wanted to follow up on this, as we have been experiencing CORS errors also when trying to export a Leaflet map using html-to-image: https://github.com/bubkoo/html-to-image.

It used to work smoothly before, so it is not clear what has changed.

Currently using:
Chrome 101.0.4951.54
https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.png

@MSCAU @ptkz have you found any solutions?

Screen Shot 2022-05-09 at 09 18 31

@MSCAU
Copy link
Author

MSCAU commented May 9, 2022

@anti-destin yes. We ended up setting up a proxy, ie. sending the requests to fastly.net from the server instead of the browser, and then serving the titles to the browser from the same domain as the rest of the page. This works well in all browsers and we haven't had a CORS warning or error since.

@chlumpchatkupt
Copy link

@MSCAU thanks for the insight! Very helpful.

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

No branches or pull requests

4 participants