ItsMrAkhil/react-styled-carousel

Doesn't work with Next.js

Closed this issue · 2 comments

stops working after page refresh
I've tried in a working project as well as in this https://github.com/zeit/next.js/tree/canary/examples/with-styled-components sandbox

TypeError: Cannot read property 'href' of undefined
    at getURL (/Project/test-slider/node_modules/next/dist/lib/utils.js:160:30)
    at new Router (/Project/test-slider/node_modules/next/dist/lib/router/router.js:99:115)
    at renderPage (/Project/test-slider/node_modules/next/dist/server/render.js:161:25)
    at Function.getInitialProps (/Project/test-slider/node_modules/next/dist/server/document.js:93:25)
    at _callee$ (/Project/test-slider/node_modules/next/dist/lib/utils.js:36:30)
    at tryCatch (/Project/test-slider/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Project/test-slider/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/Project/test-slider/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Project/test-slider/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Project/test-slider/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/Project/test-slider/node_modules/core-js/library/modules/_export.js:35:28)
    at /Project/test-slider/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
    at loadGetInitialProps (/Project/test-slider/node_modules/next/dist/lib/utils.js:70:17)
    at _callee3$ (/Project/test-slider/node_modules/next/dist/server/render.js:187:51)
    at tryCatch (/Project/test-slider/node_modules/regenerator-runtime/runtime.js:62:40)

errors in the console occur inside the next.js: window.location is undefined for some reasons

Any ideas?

@meuwka This issue is expected. And I'm working on this to fix. Will be fixed in the next release. #20

This issue is fixed. But I can't guarantee you that it'll work with the next.js's with-styled-components example. Because they're using the styled-components of version v ^2.1.0. The prerequisites for this package is v 3.1.6.