1

last week I posted the following question which I haven't been able to solve yet.

So my original problem is the following: I have a vue application which is running on my PC and can be accessed there via :8080 or localhost:8080. However I can't access this page from my phone which is in the same wifi. I also added an inbound rule for the port already (I am using windows 10 btw). I also have a flask server which hade a similar problem which could be solved by setting the host to 0.0.0.0 and adding the firewall rule.

I searched for hour and hours and most answers that are related suggested using options in the command like e.g "npm run serve --host=0.0.0.0 --disable-host-check --useLocalIp --content-base ." or to put something similar into my package.json or add an vue.config.js. There are several answers, some people use 0.0.0.0 for the host value, some their hardcoded IP, some use some options, some not. I tried so many combinations. As the vue-cli stuff seems to build onto webpack servers I tried different options from there. I also found one comment mentioning vue which can be found here. When I try to use that I however get the error

ValidationError: webpack dev server Invalid Options
options should NOT have additional properities 
options should NOT have additional properities 
options should NOT have additional properities 
options should NOT have additional properities 

My vue.config looks like the following right now

module.exports = {
  devServer: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},


    // Various Dev Server settings
    host: '0.0.0.0', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
  },
}

Something I tried out in the config before was e.g.

module.exports = {
  devServer: {
    host: '0.0.0.0',
    port: 8080,
    public: '0.0.0.0:8080',
    hot: true,
    disableHostCheck: true,
    contentBase: '.',
  },
};

I am glad about any tip on how to finally access this page via my phone or any other device.

cassini
  • 79
  • 2
  • 9

0 Answers0