Skip to content
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

Environment variable not being set correctly #1056

Open
dickravison opened this issue Dec 13, 2024 · 3 comments
Open

Environment variable not being set correctly #1056

dickravison opened this issue Dec 13, 2024 · 3 comments

Comments

@dickravison
Copy link

Hi @evroon, thanks for creating this, it's great! I'm having an issue when updating from v1.5.3 to v2.0.0+. I get this error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8400/token. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 400

This is only when using a public endpoint instead of localhost. I have set NEXT_PUBLIC_API_BASE_URL to my public endpoint and this works fine on v1.5.3 but not on v2.0.0+. It looks as though this env var isn't being set for some reason. Could the bug detailed in this issue have come back?

#843

I've tested this on v2.0.0, v2.0.1 and v2.0.2 and all of them have the same issue. Let me know if you need any more info.

@evroon
Copy link
Owner

evroon commented Dec 13, 2024

Ah that would be annoying, how do you set the environment variable? Do you pass it in docker-compose or do you build the image yourself using this variable?

@evroon
Copy link
Owner

evroon commented Dec 13, 2024

And thanks for looking at the existing issue, troubleshooting and testing it on multiple releases btw!

@dickravison
Copy link
Author

Thanks for the quick response! I'm setting it in docker-compose, like this:

services:
 ...
  bracket-frontend:
    container_name: bracket-frontend
    environment:
      NEXT_PUBLIC_API_BASE_URL: "https://api.tournament.abc.xyz"
      NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "10000000-ffff-ffff-ffff-000000000001"
      NODE_ENV: production
    image: ghcr.io/evroon/bracket-frontend:v2.0.1
    ports:
      - 3000:3000
    restart: unless-stopped
...

No worries, I know how much easier troubleshooting is when you as much info as possible! Let me know if there are any other settings that'd help troubleshoot or anything you'd like me to try to test :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants