Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/site/next.config.mjs (1)
245-255:⚠️ Potential issue | 🟠 MajorDuplicate object properties create dead code.
The
configobject definesredirects()here (returning[]) andrewrites()(returning the MDX rewrite), but both are overwritten by the later definitions at lines 269 and 745 respectively. In JavaScript, when an object literal has duplicate keys, the last value wins—so this entire block is unreachable dead code.Two concerns:
- The MDX rewrite (
/:path*.mdx→/llms.mdx/:path*) is silently removed since it's not in the newrewrites(). Verify this is intentional.- The empty
redirects()here is pointless.🔧 Remove the dead code
/** `@type` {import('next').NextConfig} */ const config = { reactCompiler: true, - async redirects() { - return []; - }, - async rewrites() { - return [ - { - source: "/:path*.mdx", - destination: "/llms.mdx/:path*", - }, - ]; - }, assetPrefix: "/site-static",If the MDX rewrite is still needed, add it to the new
rewrites()object (e.g., in thebeforeFilesorafterFilesarray).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/site/next.config.mjs` around lines 245 - 255, The object literal defines redirects() and rewrites() twice so the earlier definitions (the empty async redirects() and the async rewrites() that returns the MDX rule source:"/:path*.mdx" → destination:"/llms.mdx/:path*") are dead — remove the first redirects() or make it consistent with the final redirects(), and if the MDX rewrite is required, move its rule into the final async rewrites() (placing it in the appropriate array such as beforeFiles or afterFiles) so the MDX mapping is preserved; update or delete the empty redirects() definition accordingly and keep only the final redirects() and rewrites() implementations.
🧹 Nitpick comments (1)
apps/site/next.config.mjs (1)
795-818: Commented-out code and TODO indicate incomplete cleanup.Line 807 has a TODO questioning whether the
/jobsrewrite should be removed since there's already a redirect to/careers. Line 814-817 has commented-out RSS rewrite code.Consider resolving these before merging:
- Remove the TODO comment once you verify the
/jobspath isn't needed in fallback rewrites (the redirect at line 599-602 handles it)- Either remove or uncomment the RSS rewrite based on requirements
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/site/next.config.mjs` around lines 795 - 818, The fallback rewrites contain a TODO about the /jobs path and commented-out RSS rewrite; verify whether the existing redirect for "/jobs" -> "/careers" is relied upon (search for the redirect that points "/jobs" to "/careers") and if so remove the TODO and any redundant "/jobs" entry from the fallback array, and then either remove the commented RSS block entirely or restore it (uncomment and point to the correct feed) based on whether the RSS feed is required; update the fallback array accordingly to keep only active rewrites (e.g., entries like the "/ga.js", "/gastats.js", and "/dataguide/:any*" objects) and remove stale comments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/site/next.config.mjs`:
- Around line 23-35: The thrown Error in the production-env check uses incorrect
variable names in its messages; update the message strings constructed in the
Error (inside the if block that checks process.env.NODE_ENV and
process.env.NEXT_DOCS_ORIGIN / process.env.NEXT_BLOG_ORIGIN) to reference
NEXT_DOCS_ORIGIN and NEXT_BLOG_ORIGIN respectively so the error reads e.g.
"NEXT_DOCS_ORIGIN is required in production" and "NEXT_BLOG_ORIGIN is required
in production".
- Around line 700-704: Remove the duplicated redirect entry that has permanent:
true and source: "/blog/increased-security-static-ip-support-prisma-pulse"
pointing to "https://www.prisma.io/docs/postgres"; locate the redirects array
where that source appears and delete the second/duplicate object so only one
redirect object for that source/destination remains.
---
Outside diff comments:
In `@apps/site/next.config.mjs`:
- Around line 245-255: The object literal defines redirects() and rewrites()
twice so the earlier definitions (the empty async redirects() and the async
rewrites() that returns the MDX rule source:"/:path*.mdx" →
destination:"/llms.mdx/:path*") are dead — remove the first redirects() or make
it consistent with the final redirects(), and if the MDX rewrite is required,
move its rule into the final async rewrites() (placing it in the appropriate
array such as beforeFiles or afterFiles) so the MDX mapping is preserved; update
or delete the empty redirects() definition accordingly and keep only the final
redirects() and rewrites() implementations.
---
Nitpick comments:
In `@apps/site/next.config.mjs`:
- Around line 795-818: The fallback rewrites contain a TODO about the /jobs path
and commented-out RSS rewrite; verify whether the existing redirect for "/jobs"
-> "/careers" is relied upon (search for the redirect that points "/jobs" to
"/careers") and if so remove the TODO and any redundant "/jobs" entry from the
fallback array, and then either remove the commented RSS block entirely or
restore it (uncomment and point to the correct feed) based on whether the RSS
feed is required; update the fallback array accordingly to keep only active
rewrites (e.g., entries like the "/ga.js", "/gastats.js", and "/dataguide/:any*"
objects) and remove stale comments.
🪄 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.yaml
Review profile: CHILL
Plan: Pro
Run ID: 256c6ff8-0aaf-4bd5-8a2c-fe29f1e89f57
📒 Files selected for processing (1)
apps/site/next.config.mjs
Summary by CodeRabbit