usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
26.25k stars 1.2k forks source link

"Generate code" command not working with env variables #1762

Open ftrudeau-pelcro opened 7 months ago

ftrudeau-pelcro commented 7 months ago

Version: Windows v1.10.0

Actual behavior: Screenshot (282)

Expected behavior: For this to work I guess ¯_(ツ)_/¯

therealrinku commented 7 months ago

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.

ftrudeau-pelcro commented 7 months ago

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.

Wassim24 commented 6 months ago

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

Bruno_WgQqJ5f9ht Bruno_FK3VIfQ47U

therealrinku commented 6 months ago

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 :(

Wassim24 commented 6 months ago

Hello @therealrinku It happens only when using environment variables through an env file.

In my case:

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 :)