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

Proxy 404 when using string shorthand #1577

Closed
cunc opened this issue Jan 18, 2021 · 0 comments
Closed

Proxy 404 when using string shorthand #1577

cunc opened this issue Jan 18, 2021 · 0 comments

Comments

@cunc
Copy link

cunc commented Jan 18, 2021

Describe the bug

Proxy 404 when using string shorthand

Reproduction

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      '/frontend': 'http://example.com', // this made an 404 error when calling API, no error in terminal

      // below is OK
      '/frontend': {
        target: 'http://example.com'',
        changeOrigin: true
      }
    },
  }
})

System Info

  • vite version: 2.0.0-beta.30
  • Operating System: Big sur
  • Node version: 15.6.0
  • Package manager (npm/yarn/pnpm) and version: npm
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant