RedS
RedS9mo ago

TRPCClientError: fetch failed, using Node 18 in Docker

I have both my app and my tRPC server running in Docker via the following docker-compose config: ("navis" is the tRPC server, "retro" is the app)
version: "3.9"
services:
retro:
image: ghcr.io/***/retro:latest
ports:
- "${PORT}:${PORT}"
env_file:
- .env
restart: unless-stopped
depends_on:
- navis
volumes:
- "./config:/app//apps/retro/config"
navis:
image: ghcr.io/***/navis:latest
env_file:
- .env
restart: unless-stopped

networks:
default:
external: true
name: internal-network
version: "3.9"
services:
retro:
image: ghcr.io/***/retro:latest
ports:
- "${PORT}:${PORT}"
env_file:
- .env
restart: unless-stopped
depends_on:
- navis
volumes:
- "./config:/app//apps/retro/config"
navis:
image: ghcr.io/***/navis:latest
env_file:
- .env
restart: unless-stopped

networks:
default:
external: true
name: internal-network
My tRPC client config:
export const MailerService = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: ["navis", "3030"].join(":"),
}),
],
});
export const MailerService = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: ["navis", "3030"].join(":"),
}),
],
});
I'm getting this error when trying to send a request to my tRPC server: https://i.imgur.com/bGqxxEu.png I tried a lot of stuff, I don't have any idea why is it happening.
Imgur
Solution:
well I don't know how I missed that but noticed it when replacing the environment variables with the values while writing that message, I have to start with http:// even when using docker networks
Jump to solution
1 Reply
Solution
RedS
RedS9mo ago
well I don't know how I missed that but noticed it when replacing the environment variables with the values while writing that message, I have to start with http:// even when using docker networks