Nuxt.js: Error: Cannot read property 'serverRendered' of undefined Show all frames

Created on 30 Nov 2017  路  11Comments  路  Source: nuxt/nuxt.js

I was following the guide of vue-router: https://router.vuejs.org/en/advanced/navigation-guards.html
When I do next('/') in one component:

beforeRouteEnter (to, from, next) {
  next('/')
},

Server shows:

Error: Cannot read property 'serverRendered' of undefined Show all frames

But works well on browser rendering.

Did I miss anything?

This bug report is available on Nuxt.js community (#c2003)
bug-confirmed

All 11 comments

I have opened a pr to fix it: https://github.com/nuxt/nuxt.js/pull/2298

@Atinux this error still exists. At least with router.js plugin

@vaggelis2018 Which version of nuxt.js did you tested?
The PR is after rc11. So you have to do it on latest DEV branch.

For some reason i had version rc9. Installed the latest one but still the same issue.

@vaggelis2018
Use the next tag.

npm install nuxt@next --save

or

yarn add nuxt@next

now i get this error ReferenceError: regeneratorRuntime is not defined during compiling

The error i got was irrelevant. Your solution @NemoAlex was fixed my issue thanks

Doesn't work for me, also tried with 1.1.1 .. seem triggered by having ssr: true in plugin definitions

@jflaflamme are you using vue-material or any other framework?

@vaggelis2018 it was related to a function not able to work in SSR, I just started dev in spa mode instead yarn run dev -s
thanks anyway

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nassimbenkirane picture nassimbenkirane  路  3Comments

bimohxh picture bimohxh  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

mikekidder picture mikekidder  路  3Comments

jaredreich picture jaredreich  路  3Comments