Polyfill Promise.withResolvers and upgrade to Node 22 base image

This commit is contained in:
MiTHRAL 2026-05-26 18:18:39 -04:00
parent 072d0483bd
commit 0edacd59da
2 changed files with 12 additions and 1 deletions

View file

@ -1,4 +1,4 @@
FROM node:20-bookworm-slim
FROM node:22-bookworm-slim
WORKDIR /app

View file

@ -6,6 +6,17 @@ if (typeof globalThis.WebSocket === "undefined") {
globalThis.WebSocket = WebSocket;
}
if (typeof Promise.withResolvers === "undefined") {
Promise.withResolvers = function () {
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
};
}
try {
require("dotenv").config();
} catch (_) {