You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 29, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 29, 2025. It is now read-only.
New NEXT_PUBLIC_WEBAPP_URL not taken over for static files #319
Hi,
I initially build calcom image with the localhost:3000 url and changed it now to my correct URL, but still in the app or at some links still the localhost:3000 base url is taken.
How to force calcom to take the new URL? In the documentation is written, it's taking some time.
Thanks,
Reacted by Pierre JENICOT, Matt Voska, Mario Fernando, asokol123, Tigerblue77, Elspan, Kamil Kleina and Przemysław Erbert
Problem confirmed and also present when using official Docker images. It seems that a lot of things are statically set and cannot be changed at run time, which is a very bad design... The bottom line is that these variables shouldn't be needed to build the application 😅
Reacted by Pierre JENICOT, Timo Reymann and Przemysław Erbert
Hello @zomars@PeerRich,
sorry to ping you, as you're the main contributors to this repository, could you please have a look to this issue please ? 😉
Thanks for all the amazing work you do ! 🚀
I have some issues related to 'localhost:3000' but I do not find it anywhere.
It produces the errors below:
agenda | @calcom/web:start: ▲ Next.js 13.5.7
agenda | @calcom/web:start: - Local: http://localhost:3000
agenda | @calcom/web:start:
agenda | @calcom/web:start: ✓ Ready in 4.1s
agenda | @calcom/web:start:
agenda | @calcom/web:start: ⚠ metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
agenda | @calcom/web:start: 00:25:29:387 [WARN] orgDomains.ts Org support not enabled for hostname without "." {
agenda | @calcom/web:start: hostname: 'localhost:3000'
agenda | @calcom/web:start: }
Also, when I set confirmation required for a boking, when I click the confirmation link to e-mail message, it confirms properly but redirects to localhost:3000, for example:
I am running image calcom/cal.com:main directly, already tried to find the issue on database, eliminated the image and pulled it again but the issue persists.
Issue persists on v.5.4.0-sh (Docker image calcom/cal.com:main)
When I set confirmation required for a booking, when I click the confirmation or rejection buttons on e-mail message, it hits server and records properly the action, but redirects to localhost:3000 after that, for example:
Links on email message:
Confirm button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=accept
Reject button: https://agenda.icc.gg/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=reject
When I set confirmation required for a booking, when I click the confirmation or rejection buttons on e-mail message, it hits server and records properly the action, but redirects to localhost:3000 after that, for example:
This is being looked into. There is varying usage of the URL variables in the core code and it looks like the redirect page uses the orgSlug, whilst the other pages use the WEBAPP_URL.
This may be related to: calcom/cal.diy#12201
Hi everyone, I just created this account specifically to post about this issue. First of all, I'd like to clarify that I'm not a developer, programmer, or anything like that, just an engineer delving into AI. So, please excuse me if I say anything technically incorrect or inaccurate, but I hope to contribute something with my comment.
It turns out I've also been trying to get Calcom to work by self-hosting it within a VPS, and I ran into the issue discussed in this thread and other problems pointed out within the community:
—Redirection to localhost:3000 instead of the correct domain.
—[next-auth][error][CLIENT_FETCH_ERROR] message: 'Unexpected token p in JSON at position 4'.
—Match of WEBAPP_URL with ALLOWED_HOSTNAME failed { WEBAPP_URL: 'http://localhost:3000, ALLOWED_HOSTNAMES: [] }
Apparently, the program survives with the last two errors, although it's difficult to be sure without being able to test all its features, but the first error is certainly critical.
Anyway, the point is that I've been deploying the latest version of Calcom, 5.5.1, through Dokploy, but after trying dozens and dozens of different configurations to avoid these errors, I gave up and decided to simply deploy the version that Dokploy includes in its default image, which is 2.7.6. I noticed that when deploying this version, the first thing that appears in the logs is a script:
With Claude's help I was able to find the file and it says the following:
1 FROM=$1
2 TO=$2
3
4 if [ "${FROM}" = "${TO}" ]; then
5 echo "Nothing to replace, the value is already set to ${TO}."
6
7 exit 0
8 fi
9
10 # Only peform action if $FROM and $TO are different.
11 echo "Replacing all statically built instances of $FROM with $TO."
12
13 find apps/web/.next/ apps/web/public -type f |
14 while read file; do
15 sed -i "s|$FROM|$TO|g" "$file"
16 done
From what I understand, this script is changing all URL instances from localhost:3000 to my.domain.com. Without this script, it seems that all URL variables within Calcom are hardcoded to localhost:3000, regardless of what is specified in the yaml or .env file. I came to this conclusion since I've tried changing WEBAPP_URL a lot of times but I always get WEBAPP_URL: 'http://localhost:3000 doesn't match ALLOWED_HOSTNAME.
At least version 5.5.1 of Calcom doesn't seem to come with this script integrated, and this could explain some of the errors reported in the latest versions.
I would have liked to have tested adding the script to the latest version, but I imagine it will likely need to be tweaked to work properly, considering it was written for a much older version of the program. I'd rather leave that to those more knowledgeable.
I hope this insight is helpful and that someone takes a look into it.
Thanks for the input.
We're updating the install instructions and reworking the dockerfile.
The above was required to add runtime configurability to the application, which was already compiled to a static site during the docker build. A script like this wouldn't be included in the core Calcom.
Unfortunately, there's some new variable complexity, so using the runtime variable replacement may no longer cover all cases.
But regardless, there have been significant updates to the .env.example in the calcom/docker versus the .env.example in the calcom/cal.com repo, and we're working through those changes now. I expect if you selectively merge the calcom/cal.com env file into your calcom/docker's (or at least pull these over: https://github.com/calcom/cal.com/blob/ee073cdf350e605c5ae8ca44211e89fdc5fa7102/.env.example#L69-L72) and then build your own image, you'll have luck here.
That's not a satisfactory thing for users who need to just pull and run the image on their own - which is part of the extra work required to make these images reasonably configurable.
I am one of these guys that pull image and run it instead of building locally :p one day I will clone the repo and build an image here on github, I do not like to build images in my small server
I am waiting for this solution for months but I understand that's not easy to solve
Thanks for the input. We're updating the install instructions and reworking the dockerfile. The above was required to add runtime configurability to the application, which was already compiled to a static site during the docker build. A script like this wouldn't be included in the core Calcom.
Unfortunately, there's some new variable complexity, so using the runtime variable replacement may no longer cover all cases.
But regardless, there have been significant updates to the .env.example in the calcom/docker versus the .env.example in the calcom/cal.com repo, and we're working through those changes now. I expect if you selectively merge the calcom/cal.com env file into your calcom/docker's (or at least pull these over: https://github.com/calcom/cal.com/blob/ee073cdf350e605c5ae8ca44211e89fdc5fa7102/.env.example#L69-L72) and then build your own image, you'll have luck here.
That's not a satisfactory thing for users who need to just pull and run the image on their own - which is part of the extra work required to make these images reasonably configurable.
I build locally the image using ALLOWED_HOSTNAMES, RESERVED_SUBDOMAINS variables and got same issue 😢
Activity
tigerblue77 commentedon Nov 20, 2024
Problem confirmed and also present when using official Docker images. It seems that a lot of things are statically set and cannot be changed at run time, which is a very bad design... The bottom line is that these variables shouldn't be needed to build the application 😅
tigerblue77 commentedon Feb 26, 2025
Hello @zomars @PeerRich,
sorry to ping you, as you're the main contributors to this repository, could you please have a look to this issue please ? 😉
Thanks for all the amazing work you do ! 🚀
ivancarlosti commentedon Mar 14, 2025
Looks like the issue persists, I reported in calcom/cal.diy#20078
I have some issues related to 'localhost:3000' but I do not find it anywhere.
It produces the errors below:
Also, when I set confirmation required for a boking, when I click the confirmation link to e-mail message, it confirms properly but redirects to localhost:3000, for example:
Link on email message: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=accept
Redirect page: https://localhost:3000/booking/u16################T6XS
I am running image
calcom/cal.com:maindirectly, already tried to find the issue on database, eliminated the image and pulled it again but the issue persists.My
docker-compose.yml:My
.envitsNeutron commentedon Mar 23, 2025
Same here.
ivancarlosti commentedon May 15, 2025
Issue persists on version v.5.3.0-sh, my setup requires me to confirm the booking, when I click on confirmation link (example) https://subdomain.example.com/api/link/?token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&action=accept
It redirects to https://localhost:3000/booking/xxxxxxxxxxxxx.
The booking is confirmed properly, this redirect to localhost happens after confirmation being received and recorded on server.
How could we fix it?
tigerblue77 commentedon May 16, 2025
Hello @zomars @PeerRich @krumware, can you please help ? :)
Thanks in advance
ivancarlosti commentedon May 26, 2025
Error persists on version v.5.3.4-sh
ivancarlosti commentedon Jun 16, 2025
Issue persists on v.5.4.0-sh (Docker image calcom/cal.com:main)
When I set confirmation required for a booking, when I click the confirmation or rejection buttons on e-mail message, it hits server and records properly the action, but redirects to localhost:3000 after that, for example:
Links on email message:
Confirm button:
https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=acceptReject button:
https://agenda.icc.gg/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=rejectRedirect page:
https://localhost:3000/booking/u16################T6XSWhen I try to follow redirects using httpstatus.io, I get this error, maybe because it hoops directly to localhost because I have no issue with SSL:
krumware commentedon Jun 16, 2025
Requesting assignment for this one
ivancarlosti commentedon Jun 30, 2025
Issue persists on v.5.5.0-sh
When I set confirmation required for a booking, when I click the confirmation or rejection buttons on e-mail message, it hits server and records properly the action, but redirects to localhost:3000 after that, for example:
Links on email message:
Confirm button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=accept
Reject button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=reject
Redirect page: https://localhost:3000/booking/u16################T6XS
ivancarlosti commentedon Jul 11, 2025
Issue persists on v.5.4.19-sh
krumware commentedon Jul 11, 2025
This is being looked into. There is varying usage of the URL variables in the core code and it looks like the redirect page uses the orgSlug, whilst the other pages use the WEBAPP_URL.
This may be related to: calcom/cal.diy#12201
raulakio commentedon Jul 28, 2025
Hi everyone, I just created this account specifically to post about this issue. First of all, I'd like to clarify that I'm not a developer, programmer, or anything like that, just an engineer delving into AI. So, please excuse me if I say anything technically incorrect or inaccurate, but I hope to contribute something with my comment.
It turns out I've also been trying to get Calcom to work by self-hosting it within a VPS, and I ran into the issue discussed in this thread and other problems pointed out within the community:
—Redirection to localhost:3000 instead of the correct domain.
—[next-auth][error][CLIENT_FETCH_ERROR] message: 'Unexpected token p in JSON at position 4'.
—Match of WEBAPP_URL with ALLOWED_HOSTNAME failed { WEBAPP_URL: 'http://localhost:3000, ALLOWED_HOSTNAMES: [] }
Apparently, the program survives with the last two errors, although it's difficult to be sure without being able to test all its features, but the first error is certainly critical.
Anyway, the point is that I've been deploying the latest version of Calcom, 5.5.1, through Dokploy, but after trying dozens and dozens of different configurations to avoid these errors, I gave up and decided to simply deploy the version that Dokploy includes in its default image, which is 2.7.6. I noticed that when deploying this version, the first thing that appears in the logs is a script:
scripts/replace-placeholder.sh http://localhost:3000/ https://my.domain.com/
With Claude's help I was able to find the file and it says the following:
From what I understand, this script is changing all URL instances from localhost:3000 to my.domain.com. Without this script, it seems that all URL variables within Calcom are hardcoded to localhost:3000, regardless of what is specified in the yaml or .env file. I came to this conclusion since I've tried changing WEBAPP_URL a lot of times but I always get WEBAPP_URL: 'http://localhost:3000 doesn't match ALLOWED_HOSTNAME.
At least version 5.5.1 of Calcom doesn't seem to come with this script integrated, and this could explain some of the errors reported in the latest versions.
I would have liked to have tested adding the script to the latest version, but I imagine it will likely need to be tweaked to work properly, considering it was written for a much older version of the program. I'd rather leave that to those more knowledgeable.
I hope this insight is helpful and that someone takes a look into it.
Regards
krumware commentedon Jul 28, 2025
Thanks for the input.
We're updating the install instructions and reworking the dockerfile.
The above was required to add runtime configurability to the application, which was already compiled to a static site during the docker build. A script like this wouldn't be included in the core Calcom.
You can see the usage here: https://github.com/calcom/docker/blob/main/scripts/start.sh#L6
and then https://github.com/calcom/docker/blob/main/Dockerfile#L65
Effectively, http://localhost:3000 is the default URL. If the script is run without updating NEXT_PUBLIC_WEBAPP_URL, then you will simply be replacing all usages of http://localhost:3000 with http://localhost:3000.
Unfortunately, there's some new variable complexity, so using the runtime variable replacement may no longer cover all cases.
But regardless, there have been significant updates to the .env.example in the calcom/docker versus the .env.example in the calcom/cal.com repo, and we're working through those changes now. I expect if you selectively merge the calcom/cal.com env file into your calcom/docker's (or at least pull these over: https://github.com/calcom/cal.com/blob/ee073cdf350e605c5ae8ca44211e89fdc5fa7102/.env.example#L69-L72) and then build your own image, you'll have luck here.
That's not a satisfactory thing for users who need to just pull and run the image on their own - which is part of the extra work required to make these images reasonably configurable.
ivancarlosti commentedon Jul 30, 2025
Awesome work @krumware !
I am one of these guys that pull image and run it instead of building locally :p one day I will clone the repo and build an image here on github, I do not like to build images in my small server
I am waiting for this solution for months but I understand that's not easy to solve
Thank you again
ivancarlosti commentedon Aug 5, 2025
I build locally the image using ALLOWED_HOSTNAMES, RESERVED_SUBDOMAINS variables and got same issue 😢
ivancarlosti commentedon Aug 6, 2025
Fow now I got a workaround rewriting
proxy_redirectin my nginx reverse proxy to solve the redirect failure when accept or reject an invite approval 🎉Also, about orgDomains, this solution works fine: #434 (comment)