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

Cannot be loaded in Jest / JSDOM due to side-effect #106

Open
eric-burel opened this issue Nov 9, 2021 · 6 comments
Open

Cannot be loaded in Jest / JSDOM due to side-effect #106

eric-burel opened this issue Nov 9, 2021 · 6 comments

Comments

@eric-burel
Copy link

Hi,
I have small issue when importing a component that uses this package. It seems to call window.URL.createObjectURL as soon as you import the package (even before using it), but this function doesn't exist in JSDOM. Do you think this kind of side-effect could be avoided?

@jwasilgeo
Copy link
Contributor

@eric-burel can you provide some more info please? Perhaps some of the error logs you're seeing? What files (and line numbers?) you can tell are involved?

@amaechler
Copy link

This is due to the Mapbox GL JS bundle and has been fixed in their latest release v2.7.0 (with mapbox/mapbox-gl-js#11370).

@jwasilgeo
Copy link
Contributor

Thanks for finding and sharing that @amaechler. This library will have to remain at mapbox-gl-js v1, however. Is there any indication they'll make the change as well back in their v1?

(As a side note, we have also considered changing our dependency over to maplibre-gl-js, but do not have any concrete roadmap plans to evaluate it further yet.)

@amaechler
Copy link

That I do not know. There seem to be backports of fixes from time to time though, so it might be possible.

@jwasilgeo
Copy link
Contributor

Thanks! We can leave this here for now and monitor over time.

@shawnmgoulet
Copy link
Contributor

@gavinr can we go ahead and close this for now and re-open if necessary in the future?

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