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]: Docker: replace env variables also in JS files, make GraphiQL work #5338

Open
JannikZed opened this issue Jan 8, 2025 · 0 comments
Open
Labels
bug Something isn't working triage

Comments

@JannikZed
Copy link

Description of the issue

When starting the official docker container in a hosted env, we can use all functionalities of the dashboard without a problem. Just when we try to use the GraphiQL playground, we can't, as it tries to request the wrong default URL:
Screenshot 2025-01-08 at 12 18 18

When looking at the source code, we think that the problem is in the devmode panel component: https://github.com/saleor/saleor-dashboard/blob/9b33a11522485547e5f998ac29ca84c6ccb804a2/src/components/DevModePanel/DevModePanel.tsx
you are using process.env.API_URL here, which is only read during the build process, but not in the runtime.
It might work to just add the JS files also to the env substitution:

INDEX_BUNDLE_PATH="/app/dashboard/index.html"

Steps to reproduce the problem

Start the dashboard from the official docker container and set the API_URL to a cloud hosted saleor. Try accessing the GraphiQL playground.

What did you expect to happen?

The playground connects to the API_URL that we set during runtime. We don't need to rebuild for that to work.

Additional information

No response

Environment

Browser and version: …
OS and version: …
Dashboard version: 3.20
Core version: …

@JannikZed JannikZed added bug Something isn't working triage labels Jan 8, 2025
@JannikZed JannikZed changed the title [Bug]: Docker: replace env variables also in JS files [Bug]: Docker: replace env variables also in JS files, make GraphiQL work Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
Status: No status
Development

No branches or pull requests

1 participant