Skip to content

devServer proxy does not work as advertised #945

Closed
@Rayraegah

Description

@Rayraegah

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.

Activity

liyuanqiu

liyuanqiu commented on Apr 22, 2018

@liyuanqiu

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

Rayraegah

Rayraegah commented on Apr 23, 2018

@Rayraegah
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.

EryouHao

EryouHao commented on Jul 3, 2018

@EryouHao

@Rayraegah Has this problem been solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yyx990803@Rayraegah@EryouHao@liyuanqiu

        Issue actions

          devServer proxy does not work as advertised · Issue #945 · vuejs/vue-cli