ECONNREFUSED with TRPC call on Vercel

Xxdxd4/23/2023
Anyone run into this before? I just deployed my app to Vercel and I run into this error when I trigger a procedure. Everything works in dev but I'm sure I could be missing some change that's needed for a remote server.
Nnlucas4/23/2023
That IP is localhost
Nnlucas4/23/2023
You need to configure the deployed code to point at the correct domains or IPs
Xxdxd4/23/2023
@nlucas Thanks, yeah that seems to be the problem, but any idea where in the code I need to change this?
Nnlucas4/23/2023
This is something you set up
Nnlucas4/23/2023
on the client trpc setup most likely
Nnlucas4/23/2023
in the Link
Xxdxd4/23/2023
Guessing you mean these settings? I actually didn't touch them but I will try changing this up
        httpBatchLink({
          url: `${getBaseUrl()}/api/trpc`,
        }),

const getBaseUrl = () => {
  if (typeof window !== "undefined") return ""; // browser should use relative url
  if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`; // SSR should use vercel url
  return `http://localhost:${process.env.PORT ?? 3000}`; // dev SSR should use localhost
};
Xxdxd4/23/2023
Thanks for the help btw
Nnlucas4/23/2023
yeah getBaseUrl will be the place to look
Nnlucas4/23/2023
Might just need to ensure VERCEL_URL is set