From 522e2dcb76f92d0096177b10204bdc385375020d Mon Sep 17 00:00:00 2001 From: sudarshanvn Date: Sat, 20 May 2023 03:23:52 +0530 Subject: [PATCH] Update utils.js (#2981) Fixed following error ReferenceError: TextEncoder is not defined --- packages/pg/lib/crypto/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pg/lib/crypto/utils.js b/packages/pg/lib/crypto/utils.js index ca2b821c..5c7bf55b 100644 --- a/packages/pg/lib/crypto/utils.js +++ b/packages/pg/lib/crypto/utils.js @@ -1,5 +1,5 @@ 'use strict' - +const { TextEncoder, TextDecoder } = require('util'); const useLegacyCrypto = parseInt(process.versions && process.versions.node && process.versions.node.split('.')[0]) < 15 if (useLegacyCrypto) { // We are on an old version of Node.js that requires legacy crypto utilities.