Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: polyfill Promise.withResolvers

Brad Barbin0932181a8f11
diff --git a/apps/erp/app/polyfill.ts b/apps/erp/app/polyfill.ts
new file mode 100644
index 0000000000..205701c8d6
--- /dev/null
+++ b/apps/erp/app/polyfill.ts
@@ -0,0 +1,11 @@
+if (typeof Promise.withResolvers === "undefined") {
+ Promise.withResolvers = <T>() => {
+ let resolve!: (value: T | PromiseLike<T>) => void;
+ let reject!: (reason?: unknown) => void;
+ const promise = new Promise<T>((res, rej) => {
+ resolve = res;
+ reject = rej;
+ });
+ return { promise, resolve, reject };
+ };
+}
diff --git a/apps/erp/app/root.tsx b/apps/erp/app/root.tsx
index cd99ec3dbf..efad6ccda0 100644
--- a/apps/erp/app/root.tsx
+++ b/apps/erp/app/root.tsx
@@ -29,6 +29,7 @@ import { getMode, setMode } from "~/services/mode.server";
import Background from "~/styles/background.css?url";
import NProgress from "~/styles/nprogress.css?url";
import Tailwind from "~/styles/tailwind.css?url";
+import "./polyfill";
import { getTheme } from "./services/theme.server";
export const links: LinksFunction = () => {