Skip to content
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 does not work as advertised #945

Closed
Rayraegah opened this issue Mar 6, 2018 · 4 comments
Closed

devServer proxy does not work as advertised #945

Rayraegah opened this issue Mar 6, 2018 · 4 comments

Comments

@Rayraegah
Copy link

Rayraegah commented Mar 6, 2018

Version

3.0.0-beta.5

Reproduction link

https://github.com/Rayraegah/cli-error-axios

Steps to reproduce

  • Configure a proxy under devServer in vue.config.js (e.g. '/gists' : 'https://api.github.com')
  • Use Axios to send a POST (.e.g. axios.post('/gists/...'))
  • Use Axios to send a GET (.e.g. axios.get('/gists/...'))
  • Repeat using fetch instead of Axios (same errors)

What is expected?

The axios post request should be proxied to https://api.github.com like GET requests do. Sometimes the GET requests are not proxied.

What is actually happening?

The axios request goes to https://localhost:8080/gists/... instead of https://api.github.com/gists


The issue is the same as the one in create-react-app that was resolved recently.
refer: facebook/create-react-app#3726 and facebook/create-react-app#3311

On my main repo, GET requests were successful, only POST failed. But in the test repo - both GET and POST end in errors.

@liyuanqiu
Copy link

@yyx990803 Why close this issue? You haven't resolved this problem yet. I think a bug tag is better than closing this issue.

@Rayraegah
Copy link
Author

Just to clarify this was partially resolved in Beta-6 release. PUT and POST requests made via Axios are working but with fetch it is not.

@yyx990803
Copy link
Member

@EryouHao
Copy link

EryouHao commented Jul 3, 2018

@Rayraegah Has this problem been solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants