Fix: Make asset paths base-aware for GitHub Pages (NEXT_PUBLIC_BASE_PATH)#6
Conversation
|
Warning Review limit reached
More reviews will be available in 52 minutes and 47 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesBase-path-aware static assets
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/page.tsx`:
- Line 280: The Image component at line 280 uses a relative path source
`./tectonic-hero.png` which is fragile in base-path contexts and inconsistent
with the pattern established elsewhere in the file and codebase. Replace the
relative path with a base-aware public path format (similar to the pattern used
for the image source on line 630) to ensure the hero image src attribute
resolves correctly regardless of the base-path configuration.
In `@next.config.ts`:
- Around line 8-10: The publicBase variable on line 8 captures the raw
environment variable NEXT_PUBLIC_BASE_PATH without normalization, which can
cause Next.js configuration validation errors if the value doesn't conform to
the required format. Create a normalization function or logic that processes
publicBase to ensure it either remains an empty string or is formatted as a path
starting with / and not ending with /. Apply this normalization to publicBase
before it is used in the basePath assignment on line 9, ensuring that regardless
of the raw environment input (such as repo, /repo/, or /), the basePath variable
will always meet Next.js requirements.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5b561375-919a-4a49-a9dc-03be55a32f5e
📒 Files selected for processing (6)
app/deployments/[id]/DeploymentDetailClient.tsxapp/deployments/page.tsxapp/page.tsxcomponents/Navbar.tsxlib/deployments-ui.tsxnext.config.ts
Problem
Changes
NEXT_PUBLIC_BASE_PATHsupport and computebasePath/assetPrefixinnext.config.ts.${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}where needed (logos, video).app/page.tsxvideo reference and remove stray broken fragment.components/Navbar.tsx,lib/deployments-ui.tsx,app/deployments/page.tsx, andapp/deployments/[id]/DeploymentDetailClient.tsxto use base-aware logo paths.Notes
NEXT_PUBLIC_BASE_PATH=/Tectonic-EVM-WebUI(or set in CI) to regenerateout/with correct prefixed URLs.AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit