[GH-ISSUE #5198] [bug]: Code snippet fails to generate #1981

Closed
opened 2026-03-16 22:45:04 +03:00 by kerem · 3 comments
Owner

Originally created by @dungmv on GitHub (Jun 26, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5198

Originally assigned to: @nivedin on GitHub.

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Desktop App

Browser

Chrome

Operating System

macOS

Bug Description

When the environment's current value is empty, the tab code snippet fails to generate the curl command and displays the error message: "Something went wrong."

Deployment Type

Hoppscotch Cloud

Version

No response

Originally created by @dungmv on GitHub (Jun 26, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5198 Originally assigned to: @nivedin on GitHub. ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Desktop App ### Browser Chrome ### Operating System macOS ### Bug Description When the environment's current value is empty, the tab code snippet fails to generate the curl command and displays the error message: "Something went wrong." ### Deployment Type Hoppscotch Cloud ### Version _No response_
kerem 2026-03-16 22:45:04 +03:00
Author
Owner

@kspoojith commented on GitHub (Jun 26, 2025):

Hi! I’m new to contributing here — may I work on fixing the code snippet generation when the environment variable is empty?

<!-- gh-comment-id:3007430403 --> @kspoojith commented on GitHub (Jun 26, 2025): Hi! I’m new to contributing here — may I work on fixing the code snippet generation when the environment variable is empty?
Author
Owner

@liyasthomas commented on GitHub (Jun 26, 2025):

@kspoojith, you can try this: ideally, two cases need to be resolved:

  1. Environment variables used in request setup are not resolved from the current value. In this case, the snippet generator should fall back to the initial value if the current value is empty.
  2. When the URL field is empty, the URL should be optional in the snippet generator.
<!-- gh-comment-id:3007459267 --> @liyasthomas commented on GitHub (Jun 26, 2025): @kspoojith, you can try this: ideally, two cases need to be resolved: 1. Environment variables used in request setup are not resolved from the current value. In this case, the snippet generator should fall back to the initial value if the current value is empty. 2. When the URL field is empty, the URL should be optional in the snippet generator.
Author
Owner

@jamesgeorge007 commented on GitHub (Jul 16, 2025):

Hi, closing this issue since it's addressed in the latest release.

<!-- gh-comment-id:3078798135 --> @jamesgeorge007 commented on GitHub (Jul 16, 2025): Hi, closing this issue since it's addressed in the latest release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1981
No description provided.