Slaveworx
Slaveworx

Reputation: 611

Vue CLI is giving error ERR_CONNECTION_TIMED_OUT

I am taking my first steps with Vuex and I am trying to implement some API requests using it.

I have implemented the following structure:

Component.Vue

export default {
  created() {
     this.$store.dispatch('getData', {value: this.$route.params.title});
  },
}

VueX Store (this is the action that handles the mutation which makes the api call.)

actions: {
    getData(context, payload) {
       context.commit('getData', payload);
    },
},

Everything works as expected, content gets fetched from the API and it is rendered on the page. But if I open DevTools, each and every X seconds, a Time Out Error Appears. It says this:

sockjs.js?9be2:1606 GET http://192.168.0.00:8080/sockjs-node/info?t=1607010077338 net::ERR_CONNECTION_TIMED_OUT

Do you have any clue about what am I doing wrong?

Thank you very much!

Regards, T.

Upvotes: 1

Views: 586

Answers (1)

Dan
Dan

Reputation: 63109

This may be an issue with the Vue CLI (webpack) devServer hostname. Try this in vue.config.js:

module.exports = {
   devServer: {
      host: 'localhost'
   }
};

Upvotes: 1

Related Questions