-
Notifications
You must be signed in to change notification settings - Fork 44
fix(next-js): disable health check during build phase #1409
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
bf8ef22 to
499cb4e
Compare
PR Review: fix(next-js): disable health check during build phaseSummaryThis PR adds automatic detection of Next.js build phase to disable health checks when Code Quality ✅Positives:
Minor Suggestions:
Potential Bugs / Issues ✅No major issues found. The implementation is sound:
Performance Considerations ✅
Security Concerns ✅
Test Coverage
|
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
commit: |
PR Review: Fix Next.js Health Check During Build PhaseSummaryThis PR adds automatic detection of the Next.js build phase to disable health checks when the client is instantiated during build time. This prevents errors from attempting to connect to the ✅ Positives
🔍 Issues & Suggestions1. Inconsistency with Next.js Package (Medium Priority)The In // Metadata endpoint will not exist at 127.0.0.1:6420
inputConfig.disableHealthCheck = true;Recommendation:
2. Missing Test Coverage (High Priority)No tests were added to verify this behavior. Based on CLAUDE.md guidelines, you should add tests for:
Suggested test location: 3. Environment Variable Mutation (Low Priority)The code modifies the config.disableHealthCheck ??= true;While this works, it's mutating the input parameter. Consider whether this is intentional or if a copy should be made first. 4. Log Message Style (Low Priority - Style Consistency)Per CLAUDE.md: "Write log messages in lowercase" Current: This is already lowercase, so it's good! ✅ 5. Potential Runtime Check (Enhancement)The check only happens during client construction. If someone creates a client in a separate module that gets loaded during build, it will be caught. However, consider if there are edge cases where this might not work as expected. 🔒 Security ConsiderationsNo security concerns identified. The change only affects when health checks run and doesn't introduce new attack vectors. ⚡ Performance Considerations
📝 RecommendationsHigh Priority:
Medium Priority: Example JSDoc: /**
* Creates an instance of Client.
*
* Note: Automatically disables health checks during Next.js build phase
* to prevent connection errors when no server is running.
*/
public constructor(driver: ManagerDriver, config: ClientConfig) {✅ Approval StatusThis PR solves a real problem and is well-implemented. However, I recommend addressing the test coverage before merging to ensure the behavior is properly validated and won't regress. Verdict: Approve with requested changes (add tests) |
499cb4e to
cb08087
Compare
PR Review: fix(next-js): disable health check during build phaseOverviewThis PR adds automatic detection of Next.js build phase and disables health checks during that phase to prevent errors when the Code Quality & Best Practices ✅Strengths:
Suggestions:
Potential Bugs or Issues
|
cb08087 to
cd6bd21
Compare
cd6bd21 to
336e41c
Compare
Code Review: Fix Next.js Build Phase Health CheckThank you for this fix! I've reviewed the changes and have the following feedback: ✅ Positives
🔍 Code Quality ObservationsPotential Issue - Direct Mutation: runConfig.disableHealthCheck = true;This works because the parameter is passed by reference, but it's somewhat implicit. The mutation happens before the config is stored in
this.#config = runConfig;
if (getEnvUniversal("NEXT_PHASE") === "phase-production-build") {
logger().info("detected next.js build phase, disabling health check");
this.#config.disableHealthCheck = true;
}However, the current approach is acceptable if the config is expected to be mutable at this stage. 💡 Suggestions for Improvement
🔐 SecurityNo security concerns identified. This is defensive code that prevents unnecessary network calls during build time. ⚡ PerformancePositive Impact: Skipping health checks during build phase will speed up Next.js builds by eliminating failed network requests. 📋 SummaryThis is a well-targeted fix that solves a real problem in Next.js builds. The main question to clarify is whether this duplicates or complements the existing Recommendation: ✅ Approve with minor suggestions Review generated by Claude Code following RivetKit development guidelines |
Merge activity
|

No description provided.