[GH-ISSUE #1622] how to use TextEncoder in script? #1613

Closed
opened 2026-03-03 19:52:54 +03:00 by kerem · 1 comment
Owner

Originally created by @Geczy on GitHub (Apr 30, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1622

Description

09:43:50.313: [onRequest] with Request ID=1086
Error: ReferenceError: Can't find variable: TextEncoder
Run onRequest() func as normal (sync) mode
Error: ReferenceError: Can't find variable: TextEncoder
Skip executing the script because it is on Editing Mode. Please save and activate it (⌘S)!

https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder

Originally created by @Geczy on GitHub (Apr 30, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1622 ## Description 09:43:50.313: [onRequest] with Request ID=1086 ❌ Error: ReferenceError: Can't find variable: TextEncoder Run onRequest() func as normal (sync) mode ❌ Error: ReferenceError: Can't find variable: TextEncoder Skip executing the script because it is on Editing Mode. Please save and activate it (⌘S)! https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder
kerem 2026-03-03 19:52:54 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@Geczy commented on GitHub (Apr 30, 2023):

i ended up importing a polyfill and using that like this

const {
  TextEncoder,
  TextDecoder,
} = require("@libs/EncoderDecoderTogether.min.js");
const { Buffer } = require("@libs/buffer.min.js");
<!-- gh-comment-id:1529061218 --> @Geczy commented on GitHub (Apr 30, 2023): i ended up importing a polyfill and using that like this ```js const { TextEncoder, TextDecoder, } = require("@libs/EncoderDecoderTogether.min.js"); const { Buffer } = require("@libs/buffer.min.js"); ```
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/Proxyman#1613
No description provided.