Nuxt.js: nuxtServerInit function is not called on production but works fine on localhost

Created on 4 Sep 2019  路  2Comments  路  Source: nuxt/nuxt.js

I am using nuxt with cloude firebase. Im using nuxtServerInit function to get auth user from cookies. Function works fine on localhost but is not executed on production

In store/index.js
`export const actions = {

async nuxtServerInit({ commit }, { req }) {
const user = getUserFromCookie(req)
if (user) {
await commit('users/setCurrentUser', {
uid: user.user_id,
email: user.email,
displayName: user.name,
});
}
}
}`

Please Help

This question is available on Nuxt community (#c9723)

Most helpful comment

I'm having the same problem. Are you able to resolve this one @mavinemvento?

All 2 comments

This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c9723.

I'm having the same problem. Are you able to resolve this one @mavinemvento?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

surmon-china picture surmon-china  路  3Comments

bimohxh picture bimohxh  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

maicong picture maicong  路  3Comments

bimohxh picture bimohxh  路  3Comments