nuxt-alt / proxy

An alternative module to @nuxtjs/proxy
MIT License
24 stars 5 forks source link

Error ECONREFUSED ::1:1337 #18

Closed hi-reeve closed 10 months ago

hi-reeve commented 10 months ago

using version 2.4.7 i got an error

http proxy error at /blogs:
Error: connect ECONNREFUSED ::1:1337
    at __node_internal_captureLargerStackTrace (node:internal/errors:484:5)
    at __node_internal_exceptionWithHostPort (node:internal/errors:662:12)
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)

nuxt.config.ts

export default defineNuxtConfig({
    modules: ["@nuxt-alt/proxy"],
    devtools: { enabled: true },
    runtimeConfig: {
        public: {
            apiProxyUrl: process.env.API_PROXY_URL,
        },
    },
    proxy: {
        proxies: {
            "/proxy": {
                target: process.env.API_BASE_URL,
                changeOrigin: true,
                rewrite: path => path.replace("/proxy", ""),
                headers: {
                    Authorization: `Bearer ${process.env.API_TOKEN}`,
                },
            },
        },
    },
});

tried downgrading to version 2.3.2 and it works fine

Denoder commented 10 months ago

I am unable to reproduce this issue

hi-reeve commented 10 months ago

I am unable to reproduce this issue

here is the repro. try to upgrade the deps to v2.4.7 https://github.com/hi-reeve/nuxt-strapi-test

Denoder commented 10 months ago

I'm still not seeing the issue:

hi-reeve commented 10 months ago

seems like something is wrong with my dev server then. thankyou. will close it for now