cal.com
cal.com copied to clipboard
Self hosted url stuck at localhost:3000
Issue Summary
When self hosting the url is stuck at localhost:3000
Steps to Reproduce
- use "install to render" button
- Set any/all of the nextauth_url, NEXT_PUBLIC_* envrionment values to the correct host
- Host is still on localhost:3000
Same issue! Investigating
same here
@gone have you tried changing it to 127.0.0.1:3000 IP instead of localhost
I believe it is related to the .yaml that docker uses. I forked https://github.com/calcom/docker, adjusted the .yaml file and pushed to the server again. It fixed SOME occurrences, but I there are still some issues
Installed locally, modified the .env
file with the full https://
url for NEXT_PUBLIC_WEBAPP_URL
etc, and after login I still get bounced back to http://localhost:3000
.
I believe it's because Next.js uses port 3000 by default. Try one of these, in addition to changing the NEXT_PUBLIC_* environment variables:
- Adding
-p <PORT_NUMBER>
afternext dev
/next start
in apps/web/package.json - Running
yarn dev -- -p <PORT_NUMBER>
/yarn start -- -p <PORT_NUMBER>
same problem here
same issue here
Has anyone solved this?
+1
same issue here
Same problem. Can anyone look into it? :'(
As far as my investigation goes, it seems that nothing is set in the process.env during the deployment so everything stays as default values.
Looks like I found my problem. Just added the .env in the turbo.json.
"$schema": "https://turborepo.org/schema.json", "globalDotEnv": [".env"], "pipeline": {
same
After updating the .env file, refreshing the browser cache worked for me.
Same here, in some links it's still pointing to localhost:3000
It's been a year, I guess this won't be fixed anymore, maybe consider fork and fix on our own.
It turns out calcom is using next.js 13 and still using pages router, a quick search revealed how these environment variable is used.
The next.js doc suggest one should try to use getServerSideProps
so environment variables can be read at runtime dynamically, I'll do a proof of concept shortly.
I'm gradually fixing this by replacing most client side environment variables to incorporate getServerSideProps
instead so they will be rendered at request time.
I was a able to get it working in 2 places as of today.
https://github.com/calcom/cal.com/compare/main...persuasive0pest:cal.com:main
@nabby27 created a $30.00 reward using Opire
How to earn this reward?
Since this project does not have Opire bot installed yet π you need to go to Opire and claim the rewards through your programmer's dashboard once you have your PR ready πͺ
Hi ππΌ I created this reward because I would like to see this issue solved, maybe it's not enough but it's what I can offer if others put in their bit we can incentive some devs to solve this
According to a quick search it seems there are other instances of NEXT_PUBLIC_WEBAPP_URL
being used elsewhere:
https://github.com/search?q=repo%3Acalcom%2Fcal.com%20NEXT_PUBLIC_WEBAPP_URL&type=code
I'm not immediately able to identify if they are being imported into frontend via transitive dependency, I'll try to find a tool to assist with the investigation.
There is one outstanding variable WEBAPP_URL
located in:
https://github.com/calcom/cal.com/blob/26bd02bd9409123f50f3501471738da66554f558/packages/lib/constants.ts#L11
That is imported into frontend but it's not in app
folder.
To properly handle it I'll create a context provider and feed all such variables from there, until all of them are taken care of.
The context provider itself will be loading the values from getServerSideProps
dynamically at runtime to ensure they reflect the desired value as expected.
To resolve this issue for the Docker build, follow these steps:
- Remove the
BUILT_NEXT_PUBLIC_WEBAPP_URL
environment variable or set its value tohttp://localhost:3000
. - Set the
NEXT_PUBLIC_WEBAPP_URL
environment variable to your desired URL.
Refer to the following note from the solution reference:
# Replace the statically built BUILT_NEXT_PUBLIC_WEBAPP_URL with run-time NEXT_PUBLIC_WEBAPP_URL
# NOTE: if these values are the same, this will be skipped.
You can check the reference here: GitHub Reference.
still no solution to this?...
Any updates? Same issue here