Why am I getting ERR_CONNECTION_TIMED_OUT in Vue.js? Why am I getting ERR_CONNECTION_TIMED_OUT in Vue.js? vue.js vue.js

Why am I getting ERR_CONNECTION_TIMED_OUT in Vue.js?


Create vue.config.js with the following code:

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

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


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'  }}