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

transpiled version of {...window.location} doesn't work in IE 11 #10233

Closed
Hypnosphi opened this issue Jul 17, 2019 · 4 comments
Closed

transpiled version of {...window.location} doesn't work in IE 11 #10233

Hypnosphi opened this issue Jul 17, 2019 · 4 comments
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@Hypnosphi
Copy link
Contributor

Bug Report

Current Behavior
Using window.location in an object spread causes an error in IE 11.
E.g., if you open https://hypnosphi.github.io/repro-babel-location-ie/ in IE:
Screen Shot 2019-07-17 at 19 06 12

Input Code
https://github.com/Hypnosphi/repro-babel-location-ie

const locationCopy = {...window.location};
console.log(locationCopy);

Expected behavior/code
No error, a copy of location object logged to console

Babel Configuration (.babelrc, package.json, cli command)

https://github.com/Hypnosphi/repro-babel-location-ie/blob/master/.babelrc

Environment

  • Babel version(s): 7.5.4
  • Node/npm version: Node 10 / npm 6
  • OS: macOS 10.14.5
  • Monorepo: no
  • How you are using Babel: webpack loader

Possible Solution
Don't rely on native getOwnPropertyDescriptor as it's buggy in IE

Additional context/Screenshots
Problem doesn't reproduce if I enforce @babel/helpers versions to be 7.5.1: Hypnosphi/repro-babel-location-ie@3cecfd7
It's probably introduced by #10171 (ironically)

@babel-bot
Copy link
Collaborator

Hey @Hypnosphi! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@nicolo-ribaudo
Copy link
Member

This seems like a missing polyfill feature in core-js (which is where the code you screenshotted comes from). Could you re-open it at https://github.com/zloirock/core-js?

@zloirock
Copy link
Member

See zloirock/core-js#601 (comment)

@Hypnosphi
Copy link
Contributor Author

Seems fixed with #10189

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

4 participants