You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing a custom nx run-command target in nx.json to run a script, specifying environment variables using the "env" option, the command fails with a TypeError: Cannot convert undefined or null to object. This occurs despite following the official documentation for passing environment variables to commands.
The expected behavior is that the environment variable specified in the "env" option of the nx:run-commands executor should be correctly passed to the command being executed, allowing for successful execution of the script with the provided environment variables. No TypeErrors should occur when using documented features as expected.
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
(Additional stack trace information corresponding to the error encountered)
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
When executing a custom nx run-command target in nx.json to run a script, specifying environment variables using the "env" option, the command fails with a TypeError: Cannot convert undefined or null to object. This occurs despite following the official documentation for passing environment variables to commands.
For example:
npx nx run default-hmi:docker-build-test
Expected Behavior
The expected behavior is that the environment variable specified in the "env" option of the nx:run-commands executor should be correctly passed to the command being executed, allowing for successful execution of the script with the provided environment variables. No TypeErrors should occur when using documented features as expected.
The documentation indicates that you can use env or envFile; in fact, envFile works just as well as envFile.
See: https://nx.dev/nx-api/nx/executors/run-commands#env
env
is set as object on the json schema:nx/packages/nx/src/executors/run-commands/schema.json
Line 128 in 53693fd
GitHub Repo
There is no problem on nx 19.0.0-beta (nx-examples):
romainwg/nx-examples-env-issue@4b1d05a
But does not work on nx 18.1.3:
romainwg/nx-examples-env-issue@c45334a
Steps to Reproduce
nx.json
usingnx:run-commands
that executes a shell script and uses theenv
option to specify environment variables.npx nx run <project>:<target>
.TypeError: Cannot convert undefined or null to object
error being thrown during execution.Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: