qwik
qwik copied to clipboard
[🐞] `qwik-build` loses environment variables during parallel builds
Which component is affected?
Starters / CLI
Describe the bug
I am running parallel qwik builds
via concurrently "PUBLIC_A=1 qwik build" "PUBLIC_A=2 qwik build"
.
I'm expecting my build output to have PUBLIC_A
be 1
and 2
for the first and second builds respectively.
Instead, PUBLIC_A
is 1
for the first build's client, then 2
for all subsequent builds (e.g. first build's server build).
It appears that in run-build-command.ts
calls execaCommand
, 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
N/A
Additional Information
I assume this is fixable by replacing env: { FORCE_COLOR: true }
with env: { ...process.env, FORCE_COLOR: true }
, so that the subsequent build.*
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.