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

TypeError: images.forEach is not a function - <InnerSlider> component #1138

Closed
fjeansilva opened this issue Mar 23, 2018 · 9 comments
Closed

Comments

@fjeansilva
Copy link

Hi everyone, I'm getting the following error when I run my application on the ipad:

TypeError: images.forEach is not a function. (In 'images.forEach', 'images.forEach' is undefined)
InnerSlider_componentDidUpdate

Debugging the code it renders the component in the view, but when it executes this function it throws the error.

Only on the iPad does this happen, anyone have any idea what it could be?

screen shot 2018-03-23 at 12 35 37

screen shot 2018-03-23 at 12 36 09

@jmschlmrs
Copy link

This is the same issue as #1132.

Some (older) browsers do not provide the method 'forEach' for NodeLists, which is the return value of document.querySelectorAll().

@fjeansilva
Copy link
Author

Thanks @jmschlmrs, i'll close this issue.

@nihlton
Copy link

nihlton commented Mar 27, 2018

Heh, we both closed our issues. Oops.

@laveesingh
Copy link
Contributor

Although the problem should have been fixed by the latest verson 0.22 3.

@nihlton
Copy link

nihlton commented Mar 28, 2018

Are you referring to changes here?

46b10ce

Array.from is not supported by IE (less than edge). This will continue to be an issue unless you've polyfilled .from()

@laveesingh
Copy link
Contributor

Could you tell me if either of the following would work:
Converting to an array by spreading the NodeList object

[...images].forEach

Converting to an array by the slice method from Arrays:

Array.prototype.slice.call(images).forEach

@laveesingh laveesingh reopened this Mar 28, 2018
@jmschlmrs
Copy link

@laveesingh, can confirm that Array.prototype.forEach.call(images, function(e){}); worked for me on IE11.

On a related note, looks like react-slick is using babel-polyfill. I'm assuming NodeList.forEach() is set to be added to that after core-js (which babel-polyfill uses) releases their V3: zloirock/core-js#329.

laveesingh added a commit that referenced this issue Mar 29, 2018
laveesingh added a commit that referenced this issue Mar 30, 2018
@laveesingh
Copy link
Contributor

The referenced commit should take care of it, the changes will be released soon.

@nihlton
Copy link

nihlton commented Mar 30, 2018

thanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants