Gitpod: Problem "Invalid Host header" when using webpack (vue cli)

Created on 22 Jun 2019  路  3Comments  路  Source: gitpod-io/gitpod

https://github.com/gitpod-io/gitpod/issues/26
You can set vue.config.js in
I know that I can correct it.

But this is felt to be against frictionless coding.
So it feels good to be able to use it without this setting.

Most helpful comment

Add vue.config.js to the main directory.

The contents will be good with this:

module.exports = {
    devServer: {
        disableHostCheck: true
    }
}

All 3 comments

Thanks @mouse484! You make a great point.

And I agree, any bug that happens frequently on Gitpod should ideally be fixed in Gitpod without requiring any user action.

Actually, @32leaves didn't we already implement the host-rewriting proxy for that purpose? Shouldn't it make servers like Webpack see localhost as the host, and thus avoid the "Invalid Host Header" problem?

Where is the file vue.config.js located? or do I need to create it? I'm using vue/cli 3.9

Add vue.config.js to the main directory.

The contents will be good with this:

module.exports = {
    devServer: {
        disableHostCheck: true
    }
}
Was this page helpful?
0 / 5 - 0 ratings