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

Problems configuring API_URL in the docker image #35

Closed
kusold opened this issue May 10, 2023 · 4 comments
Closed

Problems configuring API_URL in the docker image #35

kusold opened this issue May 10, 2023 · 4 comments
Assignees

Comments

@kusold
Copy link

kusold commented May 10, 2023

I keep receiving the following error when I try to submit a lookup: Error: API_URL is undefined. Please set it in .env file.

However, when I obtain a shell inside the container, I see that the API_URL environment variable is set:

/srv # env | grep API_URL
API_URL=http://blocky.blocky.svc.cluster.local:4000

I think the problem is that the API_URL is being read with process.env.API_URL when the bundle is being built, and the container is only serving up the already built bundle.

I found some info on the vite website that might be related to this: https://vitejs.dev/guide/env-and-mode.html#production-replacement

It sounds like replacing all process.env.API_URL references with import.meta.env.API_URL might fix this.

@Mozart409
Copy link
Owner

I will fix that.

@Mozart409 Mozart409 self-assigned this May 12, 2023
Mozart409 added a commit that referenced this issue May 12, 2023
Mozart409 added a commit that referenced this issue May 12, 2023
* feat: ⬆️ bump deps

* fix: 🏷️ added types to ErrorFallback

* fix: 🩹 fix issue #35

* docs: 🔖 v0.1.0
Mozart409 added a commit that referenced this issue May 12, 2023
* feat: ⬆️ bump deps

* fix: 🏷️ added types to ErrorFallback

* fix: 🩹 fix issue #35

* docs: 🔖 v0.1.0

* ci: 💚 automatic docker push from pr to main disabled
@Mozart409
Copy link
Owner

this should be fixed in v0.1.0

@kusold
Copy link
Author

kusold commented May 16, 2023

I'm still encountering this problem with v0.1.1.

In the browser's JS console.

Error: API_URL is undefined. Please set it in .env file.

From inside the blocky-frontend container:

/srv # env | grep API
BLOCKY_API_URL=http://blocky.blocky.svc.cluster.local
BLOCKY_SERVICE_PORT_API=4000
API_URL=http://blocky.blocky.svc.cluster.local

@NeoPlayer13
Copy link

I got the same problem too.

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

3 participants