Open lyt9304 opened 5 years ago
@sodatea Any news or workaround for this?
My temporary workaround:
const config = {
target: process.env.PROXY_TARGET || 'http://localhost:8000',
secure: false,
changeOrigin: true,
logLevel: 'error',
}
const PROXY_URLS = ['api', 'media'].map(_ => '/' + _)
module.exports = PROXY_URLS.reduce(
(proxies, url) =>
Object.assign(proxies, {
[url]: config,
}),
{},
)
got the same error
I'm glad to raise a PR for it.
@jasontianxie Did you tried my workaround mentioned above?
I am facing the same error, I need to exclude part of the proxied context like this:
proxy: [
{
context: ['**', '/myapp/api/**', '!/myapp/**'],
// ...
},
],
I'm facing this issue as well. @JounQin could you provide some context for your workaround? How would you fit in this fix into vue.config.js?
Oh. NM I had to take a harder look at the code. Looks like you're generating the non-array representation that proxy can accept. Okay. Got it.
This is still a problem in v5.0.0-rc.2 Any news on this?
Version
3.9.0
Environment info
Steps to reproduce
What is expected?
should work fine
What is actually happening?
vue-cli-service serve
returns error and given hint:Actually we didn't write
proxy
in package.json, this error message makes us confusing.