adobe / aio-cli

Adobe I/O Extensible CLI
https://www.adobe.io
Apache License 2.0
77 stars 33 forks source link

aio app dev not loading .env file on Mac Os #641

Closed mboucher closed 3 days ago

mboucher commented 2 weeks ago

Expected Behaviour

I have built an AIO Action that relies on a .env variable for API keys. The .env file exists in the root folder, the app.config.yaml file has been updated to include the variable reference in the inputs section I expect that aio app dev will load the .env file and substitute the variable reference (e.g. $TEST_VARIABLE) with the value assigned in the .env file. Thus, my action would have the actual value at runtime.

Actual Behaviour

The variable in app.config.yaml is not being substituted during the build process. Therefore, the variable value is the literal variable name (e.g. $TEST_VARIABLE).

Reproduce Scenario (including but not limited to)

I have build a simple project that replicates the bug: https://git.corp.adobe.com/mboucher/aio-app-dev-bug-mac

Steps to Reproduce

The result will be {"envVariableValue":"$TEST_VARIABLE"} where the literal variable name "$TEST_VARIABLE" is returned instead of the actual value of the TEST_VARIABLE "HELLO_WORLD"

.env

You can generate this file using the command aio app use.

# This file must **not** be committed to source control

## please provide your Adobe I/O Runtime credentials
# AIO_RUNTIME_AUTH=
# AIO_RUNTIME_NAMESPACE=
TEST_VARIABLE=HELLO_WORLD

Environment Info

  System:
    OS: macOS 14.6.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 417.95 MB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.14.0/bin/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
  Virtualization:
    Docker: 26.1.1 - /usr/local/bin/docker
  npmGlobalPackages:
    @adobe/aio-cli: 10.2.0

Sample Code that illustrates the problem

https://git.corp.adobe.com/mboucher/aio-app-dev-bug-mac

Logs taken while reproducing problem

pru55e11 commented 2 weeks ago
aiojbot commented 2 weeks ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-3154

purplecabbage commented 3 days ago

This was an old prerelease version of the dev command, uninstalling it resolved the issue.