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

[Bug] Invalid SERVER_URL in the first few requests #420

Open
micouy opened this issue May 31, 2024 · 7 comments
Open

[Bug] Invalid SERVER_URL in the first few requests #420

micouy opened this issue May 31, 2024 · 7 comments
Assignees

Comments

@micouy
Copy link

micouy commented May 31, 2024

I'm running local HyperDX with the app and API ports mapped:

docker run -p 8001:8000 -p 4318:4318 -p 4317:4317 -p 8081:8080 -p 8002:8002  -e HYPERDX_APP_PORT=8081 -e HYPERDX_API_PORT=8001 hyperdx/hyperdx-local

Despite the mapping, the first few requests are sent to the default API port 8000 which results in 404s or in CORS errors if another server is running on this port:

image

It seems like NEXT_PUBLIC_SERVER_URL is empty during the first request and the hardcoded value is used instead:

export const SERVER_URL =
  process.env.NEXT_PUBLIC_SERVER_URL || 'http://localhost:8000'; // NEXT_PUBLIC_SERVER_URL can be empty string

packages/app/src/config.ts

If I change the default URL, the first few requests go to that URL.

@ernestii ernestii self-assigned this May 31, 2024
@smitt04
Copy link

smitt04 commented May 31, 2024

I can't seem to change the url at all, no matter what i set the env to it still loads as localhost which breaks when deployed somewhere else

@smitt04
Copy link

smitt04 commented May 31, 2024

turns out, the app needs to be built with those env vars preset, can not be passed into the container

@micouy
Copy link
Author

micouy commented Jun 13, 2024

@ernestii any updates on that?

@hanwenbo
Copy link

+1

@lijianow
Copy link

image

The first step is wrong. It doesn't work

@lijianow
Copy link

This docker front-end is so easy to develop why doesn't anyone update it

@johanjanssens
Copy link

johanjanssens commented Aug 24, 2024

For anyone finding this issue. You can run on a different local port by providing the HYPERDX_APP_PORT env var. For example when running on 8088 run with:

docker run -e HYPERDX_APP_PORT=8088 -p 8000:8000 -p 4318:4318 -p 4317:4317 -p 8088:8080 -p 8002:8002 hyperdx/hyperdx-local

Unsure if this is related to later fixes, it might not have worked before but it does work with v1.9.0

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

6 participants