Open CharlesStover opened 1 month ago
I've tried setting the environment variables before every script: build.client
, build.server
, and build.types
. When I console.log
the environment variables in vite.config
, I can see that they're accurate.
They don't appear to be lost until this step: Starting Qwik City SSG...
It must be specifically Qwik City SSG that is losing the context of the current process's environment.
Which component is affected?
Starters / CLI
Describe the bug
I am running parallel
qwik builds
viaconcurrently "PUBLIC_A=1 qwik build" "PUBLIC_A=2 qwik build"
.I'm expecting my build output to have
PUBLIC_A
be1
and2
for the first and second builds respectively.Instead,
PUBLIC_A
is1
for the first build's client, then2
for all subsequent builds (e.g. first build's server build).It appears that in
run-build-command.ts
callsexecaCommand
, the spawned instance uses the latest environment variable values instead of the current process's values.Reproduction
N/A
Steps to reproduce
No response
System Info
Additional Information
I assume this is fixable by replacing
env: { FORCE_COLOR: true }
withenv: { ...process.env, FORCE_COLOR: true }
, so that the subsequentbuild.*
tasks inherit the current environment variables instead of attempting to read the way they've changed since this process was run.Sorry about the lack of repro URL. It would simply take too long to setup.