question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Polyfill needed] Array.from is unsupported in Safari 8 and Internet Explorer

See original GitHub issue

Its an awesome library, however, it doesn’t work with Safari (I’ve tested Chrome and Firefox successfully).

This is the error that I get when I try to sort the items: [Error] TypeError: undefined is not a function (evaluating 'Array.from(arr)')

and this is the line that is apparently causing the problems: function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

Any suggestions on how to solve this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
DeeLindesaycommented, Mar 19, 2017

FYI The demo at http://clauderic.github.io/react-sortable-hoc doesn’t work in IE 11

I’ve added to this issue as I think it’s related?

3reactions
stenblncommented, Feb 7, 2017

Great. I’ve added the code that you linked and now it works even in Safari 8.

Maybe you find this information helpful. I’ve found out that this [].slice.call("some array") does the same thing as Array.from("some array") and it is supported also in Safari.

Thanks for the library. I really like it 🥇

Read more comments on GitHub >

github_iconTop Results From Across the Web

Alternative or polyfill for Array.from on the Internet Explorer
The OP basically needs to create simple array from his array-like object. ... While it's not supported on IE, you may use the...
Read more >
"array from" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
HTML forms in legacy browsers - Learn web development | MDN
The best way to polyfill missing API is by using the Modernizr library and its spin-off project: YepNope. Modernizr is a library that...
Read more >
Supported Browsers and Features - Next.js
Browser support and which JavaScript features are supported by Next.js. ... by your target browsers (such as IE 11), you need to add...
Read more >
Serve modern code to modern browsers for faster page loads
Here is an example of a polyfill of the Array.includes method. ... Notice how discontinued browsers, such as Internet Explorer, are included ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found