Home

Issue: 2768

Why nuxtServerInit doesn't work with axios this case?

[issue link]

I have in my actions.js

import axios from 'axios'

export default {
  nuxtServerInit ({ commit, state }, { app }) {
    axios.get(`http://api.example.com/articles/sections`)
      .then((res) => {
        commit('SET_SECTIONS', res.data)
      })
  }
}

But it doesn’t work. I also tried @nuxt/axios module, same.

This question is available on Nuxt.js community (#c2402)