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

The zone-aware formatToParts polyfill breaks in Chrome #190

Open
icambron opened this Issue Feb 18, 2018 · 9 comments

Comments

Projects
None yet
6 participants
@icambron
Member

icambron commented Feb 18, 2018

See yahoo/date-time-format-timezone#17. It means that if you've polyfilled to support zones in IE 11, the library breaks on Chrome (where it would have worked without the poly). So that is lame.

@rileytb

This comment has been minimized.

rileytb commented Mar 19, 2018

Is there any workaround for this?
I get Invalid Date w/out polyfill in IE, but with polyfill in Chrome the whole thing dies.

@icambron

This comment has been minimized.

Member

icambron commented Mar 20, 2018

I haven't found one yet

@nbdn

This comment has been minimized.

nbdn commented Jul 19, 2018

Any updates?

@martijnmelchers

This comment has been minimized.

martijnmelchers commented Jul 25, 2018

You could always check if the Zones API is already available and only load the polyfills if it is not available 👍

This also speeds up page loads!

@nbdn

This comment has been minimized.

nbdn commented Jul 25, 2018

But that is the "quick & dirty" solution of the problem (except if you're doing SSR). Imagine that you have other dependencies that use Zones API: you must check if the Zones API is available, then load the polyfill or not, then load the rest of your dependencies that need Zones API... In this case, you're just increasing your page load...

@martijnmelchers

This comment has been minimized.

martijnmelchers commented Jul 25, 2018

I am using this in Angular, when Angular is booting I check whether or not the Zones API is available if it is not I load the required polyfill(s) and if it is, there is no need for it to be loaded in.

@dmngu9

This comment has been minimized.

dmngu9 commented Oct 11, 2018

sorry im a bit of a noob here. How can check if Zones API is available, please?
@martijnmelchers

@ericmorand

This comment has been minimized.

ericmorand commented Oct 11, 2018

Can't you build and serve a different bundle to browsers that needs the polyfill?

@dmngu9

This comment has been minimized.

dmngu9 commented Oct 11, 2018

@ericmorand you mean webpack build? But it still need to know which browser to serve first

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