Skip to content

Commit 6e2004c

Browse files
committed
fix(webapp): ignore unrecognized project runtime defaults
1 parent 0f9b6c4 commit 6e2004c

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

.server-changes/default-new-project-runtime-node-24.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/webapp/app/models/runtimeEnvironment.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function toAuthenticated(
7878
defaultWorkerGroupId: env.project.defaultWorkerGroupId,
7979
organizationId: env.project.organizationId,
8080
builderProjectId: env.project.builderProjectId,
81-
defaultRuntime: BuildRuntime.nullable().parse(env.project.defaultRuntime),
81+
defaultRuntime: BuildRuntime.nullable().safeParse(env.project.defaultRuntime).data ?? null,
8282
},
8383
organization: {
8484
id: env.organization.id,

apps/webapp/app/routes/api.v1.projects.$projectRef.$env.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
6565
name: environment.project.name,
6666
apiUrl: processEnv.API_ORIGIN ?? processEnv.APP_ORIGIN,
6767
projectId: environment.project.id,
68-
defaultRuntime: BuildRuntime.nullable().parse(environment.project.defaultRuntime ?? null),
68+
defaultRuntime:
69+
BuildRuntime.nullable().safeParse(environment.project.defaultRuntime ?? null).data ?? null,
6970
};
7071

7172
return json(result);

apps/webapp/app/routes/api.v1.projects.$projectRef.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export const loader = createLoaderPATApiRoute(
5353
slug: project.slug,
5454
createdAt: project.createdAt,
5555
defaultRegion: project.defaultWorkerGroup?.name ?? null,
56-
defaultRuntime: BuildRuntime.nullable().parse(project.defaultRuntime ?? null),
56+
defaultRuntime:
57+
BuildRuntime.nullable().safeParse(project.defaultRuntime ?? null).data ?? null,
5758
organization: {
5859
id: project.organization.id,
5960
title: project.organization.title,

0 commit comments

Comments
 (0)