-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEXT_PUBLIC_API_URI Env Variable not loading correctly #43
Comments
What is your .env file for the dashboard? Also, is this for running Plunk locally on your machine? |
Is not locally, i use coolify on a VPS
This is the docker-compose file
|
I believe it might be because your API_URI is not a valid URL. |
@driaug I am facing the same issue trying to deploy it self hosted with dokploy via docker image. I have tried multiple combinations and the problem is that the request made to the backend is as described by @Iulian-Dragomirescu. Also there is a variable called NEXT_PUBLIC_API_URI that is used but not described in the docs. I have seen the variables usage in the code and what makes sense for me is this, or at least it doesnt crash the server: NEXT_PUBLIC_API_URI=/api With this config, if I try to create an account from the /auth/signup page it makes the request to: https://emails.angelhodar.com/auth/emails.angelhodar.com/api/auth/signup Are we missing something? |
now, update: it appeared twice, again ;)) the url |
I myself always test using the Docker Compose setup provided in the docs. This maps everything appropriately since API_URI=https://plunk.example.com/api
APP_URI=https://plunk.example.com version: '3'
services:
plunk:
image: "driaug/plunk"
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
environment:
REDIS_URL: '${REDIS_URL:-redis://redis:6379}'
DATABASE_URL: '${DATABASE_URL:-postgresql://postgres:postgres@db:5432/postgres}'
JWT_SECRET: '${JWT_SECRET}'
AWS_REGION: '${AWS_REGION}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}'
AWS_SES_CONFIGURATION_SET: '${AWS_SES_CONFIGURATION_SET}'
NEXT_PUBLIC_API_URI: '${API_URI}'
API_URI: '${API_URI}'
APP_URI: '${APP_URI}'
DISABLE_SIGNUPS: 'False'
entrypoint: [ "/app/entry.sh" ]
db:
image: postgres
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d postgres" ]
interval: 10s
retries: 5
timeout: 10s
redis:
image: redis |
Using the same Docker Compose setup, the only modifications I made were to the port mapping |
If I put the variables like this as you said:
Then the issue still, persists, you can test it here: https://emails.angelhodar.com/auth/signup This are the server logs when booting: |
This is actually fairly interesting. Since the automated tasks on the backend are hitting the right URL, I believe it might have to do with the way we are replacing the |
I have repulled and its the same problem. One thing that I dont understand is this line in the Dockerfile: ARG NEXT_PUBLIC_API_URI=PLUNK_API_URI |
Reason we need this is because Next.JS will take all |
I think you are on the right track with this. I'm having the same issue deploying to AWS ECS. I think the sed command sets the api uri to...
when it should be...
|
Sorry, please ignore my previous post. It was because I had set the URI without https:// when I first setup Plunk and after I corrected it either Cloudflare or AWS cached it. |
Hey, I seem to be running into the same issue here. Has anyone found a fix? |
For me the problem was that I hadn't set a full If you look at the I added a check to the PR I pushed up that checks your env vars and throws an exception if either of those isn't set to something that starts with Hope that helps! |
Just revisiting this now as I had the same issue on a new deployment of Plunk. It seems like Railway attaches the autogenerated domain to port 5000, changing this manually to 3000 and redeploying the service solved it for me. Unsure if this is the actual cause, but that at least did it for me. Also tagging you in case you're deploying on Railway as well @Lermatroid |
Yep, that was the source of my error as well, however I forgot to post a followup comment about it. Thanks! |
I had the same problem, and it was also caused by my environment variables not starting with |
I can confirm the issue is gone when I have completely removed and restarted the project, it seems to be a problem with my hosting functionality and cache. The correct format for the variables is this one:
|
Hello, I tried this open source project today, but I encountered a problem with the request made by the UI to the Backend over
HTTPS
my env file for api is:
but in the request made by the UI to the Backend it is like this:
https://plunk.exemple.ro/plunk.exemple.ro/api/users/@me
is404 Not Found
The text was updated successfully, but these errors were encountered: