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

[🐞] qwik-build loses environment variables during parallel builds #6956

Open
CharlesStover opened this issue Oct 9, 2024 · 1 comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@CharlesStover
Copy link

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.

@CharlesStover CharlesStover added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Oct 9, 2024
@CharlesStover
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant