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
-1
lines changed
packages/rivetkit/src/remote-manager-driver Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import type {
1616} from "@/driver-helpers/mod" ;
1717import type { Encoding , UniversalWebSocket } from "@/mod" ;
1818import { uint8ArrayToBase64 } from "@/serde" ;
19- import { combineUrlPath } from "@/utils" ;
19+ import { combineUrlPath , getEnvUniversal } from "@/utils" ;
2020import { sendHttpRequestToActor } from "./actor-http-client" ;
2121import {
2222 buildWebSocketProtocols ,
@@ -56,6 +56,14 @@ export class RemoteManagerDriver implements ManagerDriver {
5656 #metadataPromise: Promise < void > | undefined ;
5757
5858 constructor ( runConfig : ClientConfig ) {
59+ // Disable health check if in Next.js build phase since there is no `/metadata` endpoint
60+ //
61+ // See https://github.com/vercel/next.js/blob/5e6b008b561caf2710ab7be63320a3d549474a5b/packages/next/shared/lib/constants.ts#L19-L23
62+ if ( getEnvUniversal ( "NEXT_PHASE" ) === "phase-production-build" ) {
63+ logger ( ) . info ( "detected next.js build phase, disabling health check" ) ;
64+ runConfig . disableHealthCheck = true ;
65+ }
66+
5967 this . #config = runConfig ;
6068
6169 // Perform metadata check if enabled
You can’t perform that action at this time.
0 commit comments