ProxymanApp / ProxymanApp/Proxyman

[Scripting] Error when using built-in Promise

Open
#1,887 1 comment 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Dec 18, 2023.

✅ Done bug
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.