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

Cannot read property 'innerWidth' of undefined #5

Closed
imjared opened this issue May 31, 2017 · 6 comments
Closed

Cannot read property 'innerWidth' of undefined #5

imjared opened this issue May 31, 2017 · 6 comments
Labels

Comments

@imjared
Copy link

imjared commented May 31, 2017

We're consistently getting this error in our isomorphic app. Not sure if this is something you've seen but flagging anyways for future weary Googlers. Will update if I find a solution.

image

@Abhi0725
Copy link

@imjared
I am getting the same issue. Did you find any solution?

@theolampert
Copy link
Collaborator

theolampert commented Jul 22, 2017

Hey, I created this for use on a small project quite a while ago and haven't looked at it since. I'm not surprised it won't render server side given the way flickity works and carousels in general, it isn't possible to measure the dimensions of DOM elements server side. Honestly I'm also not sure the approach here is the best, if you're interested there is an open PR on the flickity repo itself metafizzy/flickity#381 which has a bit more detail about the issues integrating this with react. Have either of you tried initialising the component only on the client?. Having said all that I'm open to suggestions or patches here.

@theolampert
Copy link
Collaborator

@imjared @Abhi0725 could you guys try installing from the dev branch? npm install https://github.com/theolampert/react-flickity-component.git#dev

@imjared
Copy link
Author

imjared commented Jul 24, 2017

@Abhi0725 - we ended up writing our own wrapper for flickity

@timothywisdom
Copy link

I have just found that setting the Flickity option:
watchCSS: false
makes this error go away.

@amerllica
Copy link

Flickity is awesome for jQuery or VanillaJS projects, As I use it in my DIGIKALA MAG project, But it is not very useful for React project. I unstar this repo and migrate to react-slick.

This awesome repo just kill my time.

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

No branches or pull requests

5 participants