d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
502 stars 143 forks source link

d3-zoom doesn't work with core-js >3.6 on IE11 #200

Closed Yohandah closed 4 years ago

Yohandah commented 4 years ago

Hello,

I have an Angular 8 project that uses d3-zoom 1.8.3, and my project uses core-js which is normal for an Angular project.

When compiling (ng build or ng serve) with core-js 3.5 as a dependency my app works fine in Evergreen browsers, and IE11.

When compiling with core-js 3.6 as a dependency, my app works fine in Evergreen browsers, but on IE 11 I have the following error :

unknown type z and it throws when doing d3Zoom.zoom().on("zoom", () => { });

You don't even need to do something in the callback, just calling .on will throw the error ...

ashwini-balnaves commented 4 years ago

I have this exact same issue.

mbostock commented 4 years ago

This sounds like a compiler issue, not a library issue. Please see this related discussion: https://github.com/d3/d3-color/issues/68#issuecomment-537147753

Yohandah commented 4 years ago

@mbostock I don't think it is, disabling optimizer doesn't fix it, and the issue is happening with dev mode and prod mode. It really looks like an incompatibility with core-js > 3.6 ... with IE11.

I'll open an issue in the core-js or Angular repo to see what they think about that

mbostock commented 4 years ago

Do you have a stack trace? Can you try debugging? From what you’ve shared it looks like this line:

https://github.com/d3/d3-dispatch/blob/4f868212fc5b425cd11c07f929fef8a77a46adf3/src/dispatch.js#L19

Yohandah commented 4 years ago

@mbostock It does looks like that. I have tried to debug it but haven't succeeded.

I will try to reproduce the bug in a separate repo and link it to you.

a616101 commented 4 years ago

Wait for this problem to be solved,maybe this issue will disappear. ==> core-js@3.6 breaks xregexp patterns on IE11