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

"An error occurred trying to load the resource" - error in network tab when no visible missing tile #9311

Open
4 tasks done
Vasilia-Themis opened this issue Apr 3, 2024 · 3 comments

Comments

@Vasilia-Themis
Copy link

Vasilia-Themis commented Apr 3, 2024

Checklist

  • I've looked at the documentation to make sure the behavior isn't documented and expected.
  • I'm sure this is an issue with Leaflet, not with my app or other dependencies (Angular, Cordova, React, etc.).
  • I've searched through the current issues to make sure this hasn't been reported yet.
  • I agree to follow the Code of Conduct that this project adheres to.

Steps to reproduce

Bug reproduced on a number of different iOS devices
Unable to reproduce on Android or desktop

Expected behavior

  • I do not expect to see "An error occurred trying to load the resource" in the dev tools network tab

Current behavior

  • In the network tab you will see: data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs= or similar
  • The preview will say "An error occurred trying to load the resource"

image

image

Minimal example reproducing the issue

https://plnkr.co/edit/YiUS1lMzYAIZwLUs?preview

Environment

  • Leaflet version: Leaflet 1.9.4
  • Browser (with version): Safari iOS 16.2
  • OS/Platform (with version): iOS 16.2
@Vasilia-Themis Vasilia-Themis changed the title "An error occurred trying to load the resource" - publishes tileerror event when no visible missing tile "An error occurred trying to load the resource" - error in network tab when no visible missing tile Apr 3, 2024
@IvanSanchez
Copy link
Member

That URL is the one for a 1x1 transparent gif image (gosh, knowing that fact makes me a nerd). In the leaflet codebase it lives at L.Util.emptyImageURL, and is set into tiles at:

tile.src = Util.emptyImageUrl;

It has no ill effect besides that warning. It's done for historical reasons: destroying a non-completely-loaded HTMLImageElement used to crash the Android stock browser. See #137 and #5615 .

Not sure if we want to revisit this?

@IvanSanchez IvanSanchez added needs decision and removed needs triage Triage pending labels Apr 3, 2024
@Vasilia-Themis
Copy link
Author

Thank you for the quick reply @IvanSanchez. It seems to be linked with the publishing of a tileerror event on the TileLayer, which is causing us problems. This only happens intermittently so I'm not confident of the link. Does that sound plausible?

@IvanSanchez
Copy link
Member

But this is a non-issue anyway. The Safari dev tools are failing to display an image coming from a data: URL, which is different than "an image is causing an error" (since there are no errors/warnings in your console anyway).

If you have something about tileerror, then that's a different issue. Let's stick to this one.

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

2 participants