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.

feat: don't put edge runtime in root route

Brad Barbincf98c2917ca9
diff --git a/apps/carbon/app/entry.server.tsx b/apps/carbon/app/entry.server.tsx
index 5774e1ebd8..eb27bbe4c3 100644
--- a/apps/carbon/app/entry.server.tsx
+++ b/apps/carbon/app/entry.server.tsx
@@ -173,7 +173,6 @@ function handleBrowserRequest(
setTimeout(abort, ABORT_DELAY);
});
}
-
export function handleError(
error: unknown,
{ request, params, context }: LoaderFunctionArgs
diff --git a/apps/carbon/app/root.tsx b/apps/carbon/app/root.tsx
index 8416d0eb99..414d393677 100644
--- a/apps/carbon/app/root.tsx
+++ b/apps/carbon/app/root.tsx
@@ -27,7 +27,6 @@ import { error } from "~/utils/result";
import { useMode } from "./hooks/useMode";
import { getSessionFlash } from "./services/session.server";
import { modeValidator } from "./types/validators";
-import { parseVercelId } from "./utils/http";
export function links() {
return [
@@ -38,8 +37,6 @@ export function links() {
];
}
-export const config = { runtime: "edge" };
-
export const meta: MetaFunction = () => {
return [
{
@@ -57,14 +54,6 @@ export async function loader({ request }: LoaderFunctionArgs) {
} = getBrowserEnv();
const sessionFlash = await getSessionFlash(request);
- const { computeRegion, proxyRegion } = parseVercelId(
- request.headers.get("x-vercel-id")
- );
-
- console.log({
- computeRegion,
- proxyRegion,
- });
return json(
{
diff --git a/apps/carbon/app/routes/api+/trigger.ts b/apps/carbon/app/routes/api+/trigger.ts
index 831ee6cd6f..7fe412e58d 100644
--- a/apps/carbon/app/routes/api+/trigger.ts
+++ b/apps/carbon/app/routes/api+/trigger.ts
@@ -3,7 +3,7 @@ import serverRuntime from "@remix-run/server-runtime";
import { triggerClient } from "~/lib/trigger.server";
export const config = {
- runtime: "node",
+ runtime: "nodejs",
maxDuration: 300, // 5 minutes
};
diff --git a/apps/carbon/app/routes/x+/_layout.tsx b/apps/carbon/app/routes/x+/_layout.tsx
index ea45b71e11..2edcc11068 100644
--- a/apps/carbon/app/routes/x+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/_layout.tsx
@@ -25,6 +25,9 @@ import { path } from "~/utils/path";
import type { ShouldRevalidateFunction } from "@remix-run/react";
import { getAutodeskToken } from "~/lib/autodesk/autodesk.server";
+import { parseVercelId } from "~/utils/http";
+
+export const config = { runtime: "edge" };
export const shouldRevalidate: ShouldRevalidateFunction = ({
currentUrl,
@@ -53,6 +56,15 @@ export async function loader({ request }: LoaderFunctionArgs) {
const { accessToken, companyId, expiresAt, expiresIn, userId } =
await requireAuthSession(request, { verify: true });
+ const { computeRegion, proxyRegion } = parseVercelId(
+ request.headers.get("x-vercel-id")
+ );
+
+ console.log({
+ computeRegion,
+ proxyRegion,
+ });
+
// share a client between requests
const client = getSupabase(accessToken);