8000 fix: Page changed from static to dynamic at runtime /partners.dub.co/acme/apply/success, reason: searchParams.applicationId by xTudoS · Pull Request #2509 · dubinc/dub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Page changed from static to dynamic at runtime /partners.dub.co/acme/apply/success, reason: searchParams.applicationId #2509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 14, 2025

Conversation

xTudoS
Copy link
Contributor
@xTudoS xTudoS commented Jun 10, 2025

Enabled dynamic rendering in the application success page fixing issue "Page changed from static to dynamic at runtime /partners.dub.co/acme/apply/success, reason: searchParams.applicationId"

Summary by CodeRabbit

  • Chores
    • Updated page rendering behavior to ensure the success page is always dynamically rendered.

…e "Page changed from static to dynamic at runtime /partners.dub.co/acme/apply/success, reason: searchParams.applicationId"
Copy link
vercel bot commented Jun 10, 2025

@xTudoS is attempting to deploy a commit to the Dub Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link
CLAassistant commented Jun 10, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor
coderabbitai bot commented Jun 10, 2025

Walkthrough

A constant named dynamic with the value "force-dynamic" was exported at the top level of the specified page module. This change directs the framework to always render the page dynamically, overriding any static rendering defaults. No other logic or functionality within the file was altered.

Changes

File Path Change Summary
apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/apply/success/page.tsx Added export const dynamic = "force-dynamic"; to enforce dynamic rendering

Poem

In the warren of code, a flag was deployed,
To keep pages dynamic, not statically enjoyed.
Now every request brings freshness anew,
No caching or staleness will trouble this view.
The rabbits all cheer, for change is in sight—
Dynamic success, rendered just right!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e2a174 and f49dbbc.

📒 Files selected for processing (1)
  • apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/apply/success/page.tsx (1 hunks)
🔇 Additional comments (1)
apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/apply/success/page.tsx (1)

13-13: Dynamic rendering override added

The export const dynamic = "force-dynamic" directive is correctly introduced at the top of the module to enforce runtime rendering for pages that depend on searchParams.applicationId.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the fil 8000 es again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
bug0-qa-agent bot commented Jun 10, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2509:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

Copy link
bug0-qa-agent bot commented Jun 13, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2509:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

8000
Copy link
vercel bot commented Jun 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ✅ Ready (Inspect) Visit Preview Jun 14, 2025 6:58pm

@steven-tey steven-tey requested a review from Copilot June 14, 2025 18:46
@steven-tey
Copy link
Collaborator

Great catch, thank you!

@CodeRabbit final review

Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that the application success page always uses dynamic rendering at runtime by adding a dynamic export.

  • Forced dynamic rendering on the success page to support searchParams.applicationId
  • No functional changes beyond rendering mode adjustment
Comments suppressed due to low confidence (2)

apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/apply/success/page.tsx:13

  • [nitpick] Consider adding a comment above this export explaining why dynamic rendering is forced (e.g., to handle searchParams.applicationId), which will help future maintainers understand the context.
export const dynamic = "force-dynamic";

apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/apply/success/page.tsx:13

  • Add or update a test to verify that the success page correctly renders dynamically when applicationId is present in the URL search parameters.
export const dynamic = "force-dynamic";

Copy link
Contributor
coderabbitai bot commented Jun 14, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@steven-tey This PR looks excellent!

Final Review Summary ✅

Problem Solved: The page was experiencing a Next.js runtime warning where it started as static but needed to become dynamic due to searchParams.applicationId usage.

Solution Applied: Added export const dynamic = "force-dynamic"; which is the correct Next.js App Router approach to explicitly declare dynamic rendering requirements.

Key Strengths:

  • ✅ Minimal, targeted fix that addresses the root cause
  • ✅ Follows Next.js best practices for handling dynamic pages with searchParams
  • ✅ All automated tests pass
  • ✅ No breaking changes or side effects

Technical Assessment:
The force-dynamic directive ensures the page is always server-rendered on each request, which is necessary when accessing searchParams. This prevents the static/dynamic mismatch warning and ensures consistent behavior across deployments.

This is a clean, production-ready fix. Great work @xTudoS! 🎉


🏁 Script executed:

#!/bin/bash
# Read the modified file to verify the implementation
cat "apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/apply/success/page.tsx"

Length of output: 5565


Perfect! After reviewing the implementation, I can confirm this is an excellent fix.

Final Review - APPROVED

Verification Complete: The implementation is exactly what's needed:

  1. export const dynamic = "force-dynamic" correctly placed at module level
  2. SearchParams Usage: The component properly destructures { applicationId?, enrollmentId? } from searchParams
  3. Dynamic Behavior: These params drive:
    • Database queries (prisma.programApplication.findUnique)
    • Conditional rendering (hasPartnerProfile logic)
    • Dynamic content display

Why This Fix Works:

  • Next.js was trying to statically generate this page during build
  • But the page needs searchParams at runtime to function properly
  • force-dynamic ensures it's always server-rendered per request
  • This eliminates the "static to dynamic" runtime warning

Quality Assessment:

  • ✅ Minimal, surgical fix
  • ✅ Follows Next.js 13+ App Router patterns
  • ✅ No performance impact (page should be dynamic anyway)
  • ✅ All tests passing

This is production-ready! Great work @xTudoS on identifying and fixing this Next.js rendering issue. 🎉

Copy link
bug0-qa-agent bot commented Jun 14, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2509:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@steven-tey steven-tey merged commit 70cbd05 into dubinc:main Jun 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0