Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

[Scripting] Error when using built-in Promise

Open NghiaTranUIT opened this issue 1 year ago • 1 comments

Description

Proxyman accidentally overrides the built-in Promise from the Scripting Tool -> Cause many unexpected error.

Steps to Reproduce

  1. Create a script
async function testPromise() {
  return Promise.resolve("It's completed")
}

async function onRequest(context, url, request) {
  const result = await testPromise()
  console.log(result)

  // Done
  return request;
}
  1. Make a request that executes the script

Current Behavior

  • Promise.resolve doesn't exist with error: "Promise.resolve is not a function"

Expected Behavior

  • Should work

Environment

  • App version: 4.15.0

NghiaTranUIT avatar Dec 18 '23 03:12 NghiaTranUIT

Fixed: https://download.proxyman.io/beta/Proxyman_4.15.0_Update_Lodash_and_fix_Promise.dmg

NghiaTranUIT avatar Dec 18 '23 03:12 NghiaTranUIT