Nuxt.js: Refresh the page, (created) method is executed twice, server once and client once锛孌emo will also appear

Created on 7 Jun 2018  路  5Comments  路  Source: nuxt/nuxt.js

This question is available on Nuxt community (#c7209)

Most helpful comment

found answer: https://nuxtjs.org/guide/plugins

It is important to know that in any Vue instance lifecycle, only beforeCreate and created hooks are called both from client-side and server-side. All other hooks are called only from the client-side.

All 5 comments

same issue, any suggestion?

found a substitute solution
use mounted() or asyncData()

but still dont know why created() run twice

found answer: https://nuxtjs.org/guide/plugins

It is important to know that in any Vue instance lifecycle, only beforeCreate and created hooks are called both from client-side and server-side. All other hooks are called only from the client-side.

why beforeCreated and created are call twice(client and server)?
Is there some different?

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

VincentLoy picture VincentLoy  路  3Comments

bimohxh picture bimohxh  路  3Comments

vadimsg picture vadimsg  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments