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

Firefox assumes that created data blobs (using data Object instead of an URL) are XML, outputs errors #772

Open
d3d9 opened this issue Dec 26, 2020 · 1 comment
Milestone

Comments

@d3d9
Copy link

d3d9 commented Dec 26, 2020

TANGRAM VERSION: 0.21.1

ENVIRONMENT: win7 64bit Firefox 84.0.1, win10 64bit Firefox 85.0, (no errors:) win10 64bit Edge 87

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

  • use scene.setDataSource with type "GeoJSON" and data property instead of an URL
  • look at the console output (at layer rebuild)

RESULT:

There are errors at the blob locations: "XML Parsing Error: not well-formed".
Apparently the browser assumes blobs to be XML by default, if no type is given.
Outside of the console, I could not notice negative effects.

EXPECTED RESULT:

No such errors appearing in the console.

It seems like this is fixed, at least for (Geo)JSON data, by providing an object like { type: 'application/geo+json' } or at least { type: 'application/json' } to the Blob constructor here:

source.url = URLs.createObjectURL(new Blob([JSON.stringify(source.data)]));

@bcamper bcamper added this to the v0.21.2 milestone Jan 31, 2021
@bcamper
Copy link
Member

bcamper commented Jan 31, 2021

Thanks for the report and easy fix @d3d9! I wonder if this behavior has changed at some point in Firefox versions, but no matter now... this will be released in v0.21.2 and the issue will be closed then.

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

No branches or pull requests

2 participants