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.

Proxies are currently only working Dev but not in Build

See original GitHub issue

Environment

------------------------------
- Operating System: `Darwin`
- Node Version:     `v14.18.0`
- Nuxt Version:     `3.0.0-27389502.88da719`
- Package Manager:  `yarn@1.22.17`
- Bundler:          `Vite`
- User Config:      `alias`, `nitro`, `build`, `css`, `modules`, `proxy`, `vite`, `vue`, `hooks`, `components`, `privateRuntimeConfig`, `publicRuntimeConfig`
- Runtime Modules:  `@nuxtjs/proxy@2.1.0`
- Build Modules:    `-`
------------------------------

Reproduction

Here you can see a sample proxy working when the dev command is run but not working after a build and start https://stackblitz.com/edit/nuxt-starter-g2m6nk

Describe the bug

I have a few proxies setup that did work in Nuxt 2 with the @nuxtjs/proxy module. But now I am doing this with Vite and it does work in dev. But when I build or deploy to a test site none of my proxies work at all and I get a 404 page. I went ahead and installed the @nuxtjs/proxy module in my Nuxt 3 project and I get the same results in dev and build.

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
danielroecommented, Mar 2, 2022
0reactions
msonowalcommented, Mar 2, 2022

@danielroe @lperez22

Could you please provide an example to proxy the api calls using that approach as I also wanted to try that approach before axios or proxy module is ready.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

proxy not working for create-react-app in production
Proxies are for development purposes only, and they are handled by webpack-dev-server . On production you need to make the calls to the ......
Read more >
Docker run works behind proxy, and Docker build does not
It should run apt-get update/install and build the image. Additional information you deem important (e.g. issue happens only occasionally):. I have set in...
Read more >
Working with HTTP Proxies | OpenShift Container Platform 3.11
If your Git repository can only be accessed using a proxy, you can define the proxy to use in the source section of...
Read more >
What is a Proxy Server and How Does it Work? - Varonis
A proxy server acts as a gateway between you and the internet. Learn the basics about proxies with our complete, easy-to-follow guide.
Read more >
How to use proxies with Python Requests Proxy Module - Zyte
Configuring and using proxies is not easy, especially when sending HTTP requests. Built-in modules like urllib, urllib2 help us deal with HTTP requests....
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