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.

build: dont use @novu/node in edge runtime

Brad Barbin09a8dd05e52e
diff --git a/apps/carbon/app/routes/api+/novu.ts b/apps/carbon/app/routes/api+/novu.ts
index 2dcc61a8e5..62a2f116c4 100644
--- a/apps/carbon/app/routes/api+/novu.ts
+++ b/apps/carbon/app/routes/api+/novu.ts
@@ -17,4 +17,8 @@ const handler = serve({
],
});
+export const config = {
+ runtime: "nodejs",
+};
+
export { handler as action, handler as loader };
diff --git a/packages/notifications/src/index.ts b/packages/notifications/src/index.ts
index 40f256e301..85e293dc07 100644
--- a/packages/notifications/src/index.ts
+++ b/packages/notifications/src/index.ts
@@ -1,4 +1,3 @@
-import type { Novu } from "@novu/node";
import { nanoid } from "nanoid";
const API_ENDPOINT = "https://api.novu.co/v1";
@@ -52,7 +51,7 @@ export function getSubscriberId({
return `${companyId}:${userId}`;
}
-export async function trigger(novu: Novu, data: TriggerPayload) {
+export async function trigger(novu, data: TriggerPayload) {
try {
await novu.trigger(data.workflow, {
to: data.user,
@@ -73,7 +72,7 @@ export async function trigger(novu: Novu, data: TriggerPayload) {
}
}
-export async function triggerBulk(novu: Novu, events: TriggerPayload[]) {
+export async function triggerBulk(novu, events: TriggerPayload[]) {
try {
await novu.bulkTrigger(
events.map((data) => ({