g miou
g miou

Reputation: 365

Why am I getting ERR_CONNECTION_TIMED_OUT in Vue.js?

After creating a new project with vue cli 3 I get this error:

GET http://192.168.1.13:8080/sockjs-node/info?t=1538257166715 net::ERR_CONNECTION_TIMED_OUT sockjs.js?9be2:1605

Operation system: Windows 10

Upvotes: 30

Views: 19912

Answers (2)

Eric Bynum
Eric Bynum

Reputation: 730

To expand on Alexey's answer...

If your frontend app and the backend API server are not running on the same host, you will need to proxy API requests to the API server during development. This is configurable via the devServer.proxy option in vue.config.js. https://cli.vuejs.org/config/#devserver

module.exports = {
  devServer: {
    proxy: 'http://localhost:8080'
  }
}

Upvotes: 8

Alexey Ryazhskikh
Alexey Ryazhskikh

Reputation: 2500

Create vue.config.js with the following code:

module.exports = {
devServer: {

    host: 'localhost'
    }
};

https://cli.vuejs.org/config/#devserver

Upvotes: 45

Related Questions