yaodingyd / react-flickity-component

A React.js component for using @desandro's Flickity
314 stars 51 forks source link

May not work with an SSR framework #59

Closed fivetwelve closed 5 years ago

fivetwelve commented 5 years ago

Just a heads-up for anyone who may be trying to use this in a SSR-framework that it may fail.

I was trying to use this component to integrate Flickity in my Gatsby build. While it works when I do a local develop instance, it fails on a local build as well as on my CI.

Gatsby returns:

TypeError: Cannot read property 'path' of undefined

 - build.js:68 buildHTML.catch.err
    [my-project]/[gatsby]/dist/commands/build.js:68:72
 - util.js:16 tryCatcher
    [my-project]/[bluebird]/js/release/util.js:16:23

    etc...

In my case, there's an issue thread over at Gatsby that indicates that an import's SSR-compatibility could likely be the issue: https://github.com/gatsbyjs/gatsby/issues/11464

fivetwelve commented 5 years ago

I'm closing this as I think the underlying cause is with Flickity itself that uses a window reference. Flickity, as of this writing, cannot be isomorphically deployed.