[GH-ISSUE #5475] [bug]: pw.set.env not working properly #2101

Closed
opened 2026-03-16 23:12:12 +03:00 by kerem · 4 comments
Owner

Originally created by @jchennales on GitHub (Oct 9, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5475

Originally assigned to: @jamesgeorge007 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

Linux

Bug Description

When I do pw.set.env on a Post Request Script, the entire script stops, the env variable is not set and there is no error in the console.

What I expected is that the variable be set and the script continues.

Steps to reproduce

  1. Create a new request. Leave everything as default.

  2. In the "Post request script" tab, paste the following nominal script:
    console.log("before set");
    pw.env.set("hello", "world");
    console.log("after set");

  3. Open the console, run the script and you see the "before set" log and nothing else. The env var is not set.

I will attaching 2 screenshots. One showing the console log when it fails, and one when it succeds in v25.8.1

Image Image

This started happening when I upgraded today from a somewhat old version to current. I started trying intermediate versions and could pinpoint the first version where it fails which is 25.9.0. In version 25.8.1 it works as expected.

  • Device specifics:

I am using AppImage files in a Fedora 42 KDE (wayland)

Deployment Type

Self-hosted (on-prem deployment)

Version

v25.9.1

Originally created by @jchennales on GitHub (Oct 9, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5475 Originally assigned to: @jamesgeorge007 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 Linux ### Bug Description When I do pw.set.env on a Post Request Script, the entire script stops, the env variable is not set and there is no error in the console. What I expected is that the variable be set and the script continues. ## Steps to reproduce 1. Create a new request. Leave everything as default. 2. In the "Post request script" tab, paste the following nominal script: console.log("before set"); pw.env.set("hello", "world"); console.log("after set"); 3. Open the console, run the script and you see the "before set" log and nothing else. The env var is not set. I will attaching 2 screenshots. One showing the console log when it fails, and one when it succeds in v25.8.1 <img width="1129" height="1047" alt="Image" src="https://github.com/user-attachments/assets/9839b3e6-68a5-4be4-9ff1-de8576db0ff0" /> <img width="1131" height="1045" alt="Image" src="https://github.com/user-attachments/assets/f2a04a1d-5e9d-449a-9faa-1d26ba2df552" /> This started happening when I upgraded today from a somewhat old version to current. I started trying intermediate versions and could pinpoint the first version where it fails which is 25.9.0. In version 25.8.1 it works as expected. - Device specifics: I am using AppImage files in a Fedora 42 KDE (wayland) ### Deployment Type Self-hosted (on-prem deployment) ### Version v25.9.1
kerem 2026-03-16 23:12:12 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jamesgeorge007 commented on GitHub (Oct 10, 2025):

Hi @jchennales, this is a known issue that has been addressed in #5433 and is live in the latest release across all web platforms.

However, please note that the Desktop App update is still pending and will be included in an upcoming release.

In the meantime, we recommend either of the following:

Let me know if you have any questions!

<!-- gh-comment-id:3388730196 --> @jamesgeorge007 commented on GitHub (Oct 10, 2025): Hi @jchennales, this is a known issue that has been addressed in #5433 and is live in the [latest release](https://github.com/hoppscotch/hoppscotch/releases/tag/2025.9.2) across all web platforms. However, please note that the Desktop App update is still pending and will be included in an upcoming release. In the meantime, we recommend either of the following: - Enable the [experimental scripting sandbox](https://docs.hoppscotch.io/documentation/features/scripts#hopp-%5Bexperimental%5D) via `Settings > Experiments` in the Desktop App, or - Use the web app if you prefer to continue using the [legacy scripting sandbox](https://docs.hoppscotch.io/documentation/features/scripts#pw-%5Blegacy%5D). Let me know if you have any questions!
Author
Owner

@jchennales commented on GitHub (Oct 13, 2025):

That's great. I am fine with 25.8.1 in the meantime.
I will look into the new scripting API. I know I will have to update my scripts at one point. Thank you!

<!-- gh-comment-id:3397655721 --> @jchennales commented on GitHub (Oct 13, 2025): That's great. I am fine with 25.8.1 in the meantime. I will look into the new scripting API. I know I will have to update my scripts at one point. Thank you!
Author
Owner

@denware commented on GitHub (Oct 14, 2025):

* Enable the [experimental scripting sandbox](https://docs.hoppscotch.io/documentation/features/scripts#hopp-%5Bexperimental%5D) via `Settings > Experiments` in the Desktop App, or

thanks is working

<!-- gh-comment-id:3401290669 --> @denware commented on GitHub (Oct 14, 2025): > * Enable the [experimental scripting sandbox](https://docs.hoppscotch.io/documentation/features/scripts#hopp-%5Bexperimental%5D) via `Settings > Experiments` in the Desktop App, or > thanks is working
Author
Owner

@jamesgeorge007 commented on GitHub (Oct 31, 2025):

Closing this issue as the Desktop App release is now live, resolving the issue across platforms. Please let us know if you have any feedback.

<!-- gh-comment-id:3474131820 --> @jamesgeorge007 commented on GitHub (Oct 31, 2025): Closing this issue as the Desktop App release is now live, resolving the issue across platforms. Please let us know if you have any feedback.
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#2101
No description provided.