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
'Symbol' is undefined problem in ie11 #7597
Comments
Hey @lykhatskyi! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
Note the
Given that, it would be up to you to ensure that any necessary ES6 polyfills are available, or else avoid using syntax in Babel that would depend on ES6 functionality that hasn't been polyfilled. |
@loganfsmyth That sounds promising but doesn't solve the problem. |
then what's the purpose of Babel? |
Babel will do the polyfilling for you. But if you say As far as my comment above goes, I solved it by using babel-polyfill. I was using polyfill.io which was causing the |
I don't see why polyfilling Most of the babel helpers have guards ensuring |
That's totally fair. If someone wants to submit a PR I'd be happy to accept it. |
That’s great; one will be incoming very soon! |
Ensure that `Symbol` exists and is a function before using it. We ran into an issue with the usage of `Symbol` breaking on ie11 because it is not supported.
Ensure that `Symbol` exists and is a function before using it. We ran into an issue with the usage of `Symbol` breaking on ie11 because it is not supported.
Ensure that `Symbol` exists and is a function before using it. In `iterableToArray` we update the condition to check for objects that act as arrays such as, objects with the `length` property, Maps, and Sets. This change is being made because we ran into an issue with the usage of `Symbol` breaking on ie11 because it is not supported.
Update babel helpers to not require Symbol to exist. We ran into an issue with ie11 where Symbol is not supported. This PR gaurds the usage of Symbol by ensuring that it exists first. There are also changes that allow objects with a length property and array-like objects to work with `iterableToArray`.
Update babel helpers to not require Symbol to exist. We ran into an issue with ie11 where Symbol is not supported. This PR gaurds the usage of Symbol by ensuring that it exists first. There are also changes that allow objects with a length property and array-like objects to work with `iterableToArray`.
Stuck with the same issue :( |
@kofifus All you can do is rely on a workaround. I have the same problem where babel compiles |
Our temporary workaround has been to manually patch the file generated pending the PR landing. |
@timtox You can use normal for-of and the |
@nicolo-ribaudo Sorry for late response but thank you for the tip with the babel plugin. Is there a list of ES6 features which are not baked into the babel core and one must use a plugin to transform them properly for older Browsers? |
@timtox every single one that adds syntax :-) |
Thank you :-) |
We hit babel/babel#7597 with our logic turning `NodeList` to an array, but turned out it's not needed there. Fixes carbon-design-system#2068.
We hit babel/babel#7597 with our logic turning `NodeList` to an array, but turned out it's not needed there. Fixes #2068. Note: merging without reviewing on IE11 because designers are not set up with IE11. Will make an IE11 specific visual pass on all components & website after release.
Babel transpiles the [...arr] using Symbols which are undefined in ie11 fixes #229 related to babel/babel#7597
Still an issue for me too. I've had this come up recently. |
i tried importing |
So looks like the PR died out and then was closed out because it was never approved. Is anyone else taking a look into this? I had to import Symbol and Array.from polyfills into my app to get around this, but those are causing their own IE11 issues as well, just fewer than this caused. |
Because of that bug I had to stop using |
This report is not about If you are not using iterators I assume that you are using I'm working on a fix for this issue which is smaller than the PR which was discarded: it only works with array and array-like objects. This should make it easier to land it. |
@nicolo-ribaudo just wanted to say thank you so much for fixing this. Any idea when it may land in a stable version of Babel? My use case is indeed the |
Hi Mike! You can follow the PRs in https://github.com/babel/babel/projects/12 for updates. If you have any comments about those PRs, please let us know! |
Great work!
Would this also work for jQuery? My other use case is:
EDIT: nevermind, sound like it will work, given this PR https://github.com/babel/babel/pull/11265/files |
In which Babel release will this be shipped? So far I still see the failing version if assumeArray is false. |
Objects defined as iterable by the spec are supported starting from Babel 7.9.0. Array-like objects (which are not iterable, and technically shouldn't work with |
@nicolo-ribaudo fwiw arraylike objects don't need to work, just arrays, Maps, Sets, and strings. |
It should work with all the dom collections, that in old browsers are normal array-like objects. However, it will be opt-in since it's not spec-compliant. |
The DOM collections can't be identified beyond just by being arraylike? I'd expect their Object.prototype.toString to differ. |
babel/packages/babel-runtime/helpers/builtin/iterableToArray.js
Line 2 in e2c5f25
getting an error in ie11,
Can we change this check?
A lot of clients are using different js validators that decrease app rating because of this error
The text was updated successfully, but these errors were encountered: