bruno
bruno copied to clipboard
"Generate code" command not working with env variables
Version: Windows v1.10.0
Actual behavior:
Expected behavior: For this to work I guess ¯_(ツ)_/¯
Hi @ftrudeau-pelcro ! can you confirm if you have selected the right environment, in which those env variables are available I can only replicate it when I select the wrong environment or not select any environment at all.
can you confirm if you have selected the right environment, in which those env variables are available
I confirm.
The correct environment is selected (I only have one anyway), the .env
file exists, variables exists and are populated with their intended values.
Let me know if you need something else to diagnose.
Hello,
We are facing the same issue here while using bruno :) Here is a screenshot of what is happening when we try to generate code with env variables.
I checked the console for eventual errors but got none.
Let met know, if you need more details.
Thank you
Hi @Wassim24 does this happen everytime or there is any specific steps that need to be followed to replicate this error ? because I wasn't able to replicate this :(
Hello @therealrinku It happens only when using environment variables through an env file.
In my case:
- I have a
.env
file containing all my secrets.
HOST=myhost
API_KEY=key
- I have my environment file
PROD.bru
defining the variables I need for my collection. For example :
vars {
host: {{process.env.HOST}}
api_key: {{process.env.API_KEY}}
After that, I create my requests using the vars defined per environment.
When trying to generate the code, i get the error shown in the previous screenshots.
I hope it helps :)