Accounts Error: "Unknown Error: Failed to Fetch"
I am using nginx to host the service on "localhost". I am then using Cloudflare Tunnel to expose it to the internet. I am getting the error: "Failed to fetch" when attempting to login or create account. I set the URL to my domain as well, so not sure what the problem is. Please advise.
welcome to club, read below
Not sure what you mean, there’s nothing below your reply.
@MadMaximusJB Hello, thanks for your interest in Huly! You need to make sure your accounts service is reachable from the client's side (e.g. browser). It's configured in the front service with the ACCOUNTS_URL environment variable.
@MadMaximusJB Hello, thanks for your interest in Huly! You need to make sure your
accountsservice is reachable from the client's side (e.g. browser). It's configured in thefrontservice with theACCOUNTS_URLenvironment variable.
Hello, I had already changed that to “{domain.com}:3000”. Is there something else I’m meant to do?
I don't know any details about the Cloudflare Tunnel configuration but basically as with any other additional "proxy" on top of the basic "local" installation it's up to you to make sure everything that needs to be exposed is exposed correctly and accessible from where it's required. In your case the error says that the account service is not reachable from the client side using the given URL.
I don't know any details about the Cloudflare Tunnel configuration but basically as with any other additional "proxy" on top of the basic "local" installation it's up to you to make sure everything that needs to be exposed is exposed correctly and accessible from where it's required.我不知道有关 Cloudflare Tunnel 配置的任何细节,但基本上与基本“本地”安装之上的任何其他附加“代理”一样,您需要确保需要公开的所有内容都正确公开,并且可以从需要的地方访问。 In your case the error says that the account service is not reachable from the client side using the given URL.在您的情况下,错误表示无法使用给定的 URL 从客户端访问 Account Service。
I have opened all the port, it still not work.
When I use http only, it works will. But it doesn't work on https.
@MadMaximusJB Hello, thanks for your interest in Huly! You need to make sure your
accountsservice is reachable from the client's side (e.g. browser). It's configured in thefrontservice with theACCOUNTS_URLenvironment variable.
What he mentioned is correct — I'm just elaborating on it in more detail.
Hi all, The issue has been resolved. Please refer to the attached screenshot for reference.
✅ Solution: Update the account section in your compose.yml with the following lines (replace 8081 with your desired port if needed):
- FRONT_URL=http://localhost:8081(Any port)
- ACCOUNTS_URL=http://localhost:8081(Any port)