-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devServer.proxy do not support array type and error msg is confusing #4229
Comments
@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:
|
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 |
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.The text was updated successfully, but these errors were encountered: