This repository was archived by the owner on Oct 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/rivetkit/src/client Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type { Encoding } from "@/actor/protocol/serde";
44import type { ManagerDriver } from "@/driver-helpers/mod" ;
55import type { ActorQuery } from "@/manager/protocol/query" ;
66import type { Registry } from "@/registry/mod" ;
7+ import { getEnvUniversal } from "@/utils" ;
78import type { ActorActionFunction } from "./actor-common" ;
89import {
910 type ActorConn ,
@@ -170,6 +171,14 @@ export class ClientRaw {
170171 * Creates an instance of Client.
171172 */
172173 public constructor ( driver : ManagerDriver , config : ClientConfig ) {
174+ // Disable health check if in Next.js build phase since there is no `/metadata` endpoint
175+ //
176+ // See https://github.com/vercel/next.js/blob/5e6b008b561caf2710ab7be63320a3d549474a5b/packages/next/shared/lib/constants.ts#L19-L23
177+ if ( getEnvUniversal ( "NEXT_PHASE" ) === "phase-production-build" ) {
178+ logger ( ) . info ( "detected next.js build phase, disabling health check" ) ;
179+ config . disableHealthCheck = true ;
180+ }
181+
173182 this . #driver = driver ;
174183
175184 this . #encodingKind = config . encoding ?? "bare" ;
You can’t perform that action at this time.
0 commit comments