toomuchdesign / next-react-router

A documented attempt of using Next.js + react-router
MIT License
51 stars 15 forks source link

TypeError: Cannot read property 'originalUrl' of undefined #3

Open antonioOrtiz opened 4 years ago

antonioOrtiz commented 4 years ago

Hi there! Thank you for creating this integration!

To give you some background I was trying to use the vanilla next-router with semantic-ui-react (one of their menu components had some weird behavior), but couldn't get it to work.

Your solution is working mostly but I am getting

I am getting TypeError: Cannot read property 'originalUrl' of undefined

This is the full error:

VM47 main.js:11109 Error in error page `getInitialProps`:  TypeError: Cannot read property 'originalUrl' of undefined
    at getInitialProps$ (VM44 _app.js:92714)
    at tryCatch (VM47 main.js:768)
    at Generator.invoke [as _invoke] (VM47 main.js:997)
    at Generator.prototype.<computed> [as next] (VM47 main.js:820)
    at tryCatch (VM47 main.js:768)
    at invoke (VM47 main.js:858)
    at VM47 main.js:893
    at new Promise (<anonymous>)
    at new F (VM47 main.js:2587)
    at callInvokeWithMethodAndArg (VM47 main.js:892)
    at AsyncIterator.enqueue [as _invoke] (VM47 main.js:915)
    at AsyncIterator.prototype.<computed> [as next] (VM47 main.js:820)
    at Object.push../node_modules/@babel/runtime-corejs2/node_modules/regenerator-runtime/runtime.js.exports.async (VM47 main.js:942)
    at Function.getInitialProps (VM44 _app.js:92709)
    at VM44 _app.js:56168
    at step (VM44 _app.js:56086)
    at Object.next (VM44 _app.js:56067)
    at VM44 _app.js:56061
    at new Promise (<anonymous>)
    at push../node_modules/next-redux-wrapper/es6/index.js.__awaiter (VM44 _app.js:56057)
    at Function._a.getInitialProps (VM44 _app.js:56148)
    at loadGetInitialProps$ (VM47 main.js:10327)
    at tryCatch (VM47 main.js:768)
    at Generator.invoke [as _invoke] (VM47 main.js:997)
    at Generator.prototype.<computed> [as next] (VM47 main.js:820)
    at tryCatch (VM47 main.js:768)
    at invoke (VM47 main.js:858)
    at VM47 main.js:893
    at new Promise (<anonymous>)
    at new F (VM47 main.js:2587)
    at callInvokeWithMethodAndArg (VM47 main.js:892)
    at AsyncIterator.enqueue [as _invoke] (VM47 main.js:915)
    at AsyncIterator.prototype.<computed> [as next] (VM47 main.js:820)
    at Object.push../node_modules/@babel/runtime-corejs2/node_modules/regenerator-runtime/runtime.js.exports.async (VM47 main.js:942)
    at Object.loadGetInitialProps (VM47 main.js:10285)
    at Router.getInitialProps (VM47 main.js:10016)
    at VM47 main.js:9800
    at new Promise (<anonymous>)
    at new F (VM47 main.js:2587)
    at VM47 main.js:9799

Could you take a look? This is my repo.

Thanks!!!!