question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

devProxy not work

See original GitHub issue

Environment

  • Operating System: Darwin
  • Node Version: v16.15.1
  • Nuxt Version: 3.0.0
  • Nitro Version: 1.0.0
  • Package Manager: npm@8.11.0
  • Builder: vite
  • User Config: runtimeConfig, ssr, nitro
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/KaiEi1020/nuxt-app.git

Describe the bug

i’m use ssr mode。and i want proxy client and sever side request to another server。here is my config of nuxt.config.ts,but now it not work。and if i want Authorization for my request both client and server side only in dev mode?

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  runtimeConfig: {
    apiSecre: '125',
    public: {
      apiBase: '/api/2345ty'
    }
  },
  ssr: true,
  nitro: {
    devProxy: {
      '/api/itable': {
        target: 'http://idata-staging.cai-inc.com',
        changeOrigin: true,
      },
    }
  },
})

Additional context

No response

Logs

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pweimanncommented, Nov 24, 2022

Hello, I’m having the same issue without ssr mode.

1reaction
domWintercommented, Nov 25, 2022

So with SSR disabled I am not able to use the nitro devProxy?

Before I was using vite’s dev proxy which worked fine with SSR set to false.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue proxy setting does not work - Stack Overflow
I have a Vue project from @vue/cli 3.x. The proxy I defined in package.json based on this article is not working. The destination...
Read more >
devServer proxy(in vue.config.js) not working - Get Help
I encountered this problem, too. devServer proxy not working What should i do? vue.config.js exists in root dir of vue project.
Read more >
Server Options - Vite
When running Vite on WSL2, file system watching does not work when a file is edited by Windows applications (non-WSL2 process).
Read more >
Configuration - ️ Nitro - UnJS
devProxy. Proxy configuration for development server. You can use this option to override development server routes and proxy-pass requests.
Read more >
Dev server proxy - Vue.js Developers
What this will do is - any outgoing requests to the dev server which are not recognized - before throwing a 404 it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found