Default env variables are not being picked by Dashboard application
Labels: bug, dashboard, configuration, env
Affected app: apps/dashboard
Env vars involved:
NEXT_PUBLIC_DEFAULT_NAMESPACE=WhatPeopleWant
NEXT_PUBLIC_DEFAULT_API_KEY=exosphere@123
Summary
The Dashboard does not read the default public env variables for namespace and API key. The UI falls back to empty or hardcoded values even when the variables are set.
Expected
When the two NEXT_PUBLIC_* variables are set, the Dashboard should use them as defaults on first load without any manual input.
Actual
The variables appear undefined in the client at runtime. Defaults are not applied.
Impact
Onboards and local demos require extra steps and can be confusing. CI builds and preview deployments may not reflect the intended defaults.
Steps to reproduce
-
Create an env file with the following content.
- If using Turborepo, place it at
apps/dashboard/.env.local.
- If running the Dashboard directly, place it next to
next.config.js.
NEXT_PUBLIC_DEFAULT_NAMESPACE=WhatPeopleWant
NEXT_PUBLIC_DEFAULT_API_KEY=exosphere@123
- Start the app:
pnpm dev from apps/dashboard.
- Open
http://localhost:3000 and check that defaults are not applied.
Diagnostics checklist
Likely root causes
- Env file location in monorepo. The
.env.local is at the workspace root instead of apps/dashboard/.env.local, so the Dashboard app does not load it.
- No server restart after changing env. Client inlining happens at build or dev server startup.
- Docker build vs runtime mismatch. Client env is inlined at build time. If the variables are set only at container runtime, client code will still see the old values. In Docker, pass them as build args or rebuild when they cha
Default env variables are not being picked by Dashboard application
Labels: bug, dashboard, configuration, env
Affected app:
apps/dashboardEnv vars involved:
Summary
The Dashboard does not read the default public env variables for namespace and API key. The UI falls back to empty or hardcoded values even when the variables are set.
Expected
When the two
NEXT_PUBLIC_*variables are set, the Dashboard should use them as defaults on first load without any manual input.Actual
The variables appear undefined in the client at runtime. Defaults are not applied.
Impact
Onboards and local demos require extra steps and can be confusing. CI builds and preview deployments may not reflect the intended defaults.
Steps to reproduce
Create an env file with the following content.
apps/dashboard/.env.local.next.config.js.pnpm devfromapps/dashboard.http://localhost:3000and check that defaults are not applied.Diagnostics checklist
Restarted the dev server after adding or changing env values. Next.js reads
.env*on process start.Verified the file path is correct for a monorepo. Next.js resolves env files relative to the app that runs
next devornext build.Confirmed the names are exactly
NEXT_PUBLIC_DEFAULT_NAMESPACEandNEXT_PUBLIC_DEFAULT_API_KEY.Printed values in a client component to verify inlining works.
Printed values in a server context. Server code reads
process.envat runtime, client reads build-time inlined strings.Likely root causes
.env.localis at the workspace root instead ofapps/dashboard/.env.local, so the Dashboard app does not load it.