Nuxt.js: app : undefined in ctx of async asyncData (ctx)

Created on 27 Jul 2017  路  4Comments  路  Source: nuxt/nuxt.js

Hi!

Why there is no app in the context for async asyncData (ctx) in the client side requests?
There is only for SSR.

Most helpful comment

Fixed in rc3, sorry about this.

All 4 comments

Also experiencing this issue with rc2

  async asyncData ({ app, redirect }) {
    return app.$axios.get('/blog')

gives a 500 error Cannot read property '$axios' of undefined

@pimlie as a temporary workaround you can do

 async asyncData ({ store, redirect }) {
    return store.$axios.get('/blog')

But I think this is a bug

Fixed in rc3, sorry about this.

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

maicong picture maicong  路  3Comments

lazycrazy picture lazycrazy  路  3Comments

vadimsg picture vadimsg  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

mikekidder picture mikekidder  路  3Comments