insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Generate Client Code silently fails if an environment variable is undefined

Open relgames opened this issue 2 years ago • 2 comments

Expected Behavior

Should be possible to generate a code with Generate Client Code dialog or via Copy as cUrl.

Actual Behavior

Generate Client Code dialog is not working - dropdowns are not working as well Also Copy as cUrl is not working.

https://user-images.githubusercontent.com/179605/171406432-08eff024-8487-4984-a429-c28ced9b773e.mov

Reproduction Steps

  1. Click Generate Code in the request menu
  2. Try to click on dropdowns Shell or Wget

Is there an existing issue for this?

Additional Information

Version: Insomnia 2022.3.0 Build date: 4/28/2022 OS: Darwin x64 21.4.0 Electron: 17.3.1 Node: 16.13.0 V8: 9.8.177.13-electron.0 Architecture: x64

Insomnia Version

2022.3.0

What operating system are you using?

macOS

Operating System Version

macOS Monterey 12.3.1

Installation method

homebrew

Last Known Working Insomnia version

Not sure which version but it worked previously

relgames avatar Jun 01 '22 12:06 relgames

Found the reason, one of variables was not defined - but it was not indicating it anywhere. Need to display an error message.

relgames avatar Jun 01 '22 12:06 relgames

Hi @relgames, thank you for reporting this! I was able to reproduce this as well.

Indeed this is a bug, we don't warn the user at the very least the same way we do when trying to send a request with an undefined variable.

This happens both for Generate Code and the Copy as Curl options. We are hiding the errors in both cases:

Screenshot 2022-06-02 at 11 34 29

Screenshot 2022-06-02 at 11 33 41 Screenshot 2022-06-02 at 11 33 37

@relgames I would like to encourage you to report any other issues you may find in the meantime 👍

filfreire avatar Jun 02 '22 10:06 filfreire

Hi all 👋

I am interested in working on this issue as my first contribution to the project. Is this still relevant? I'm eager to help out where I can.

rafael-almeida avatar Aug 26 '23 22:08 rafael-almeida