Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 WalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 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 |
🍈 Lychee Link Check Report3660 links: ❌ Errors
Full Statistics Table
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/docs/next.config.mjs`:
- Around line 29-37: The redirects() implementation currently defines an
unconditional catch-all redirect that makes the app unreachable and can cause
cached 308 redirects; update the redirects() function to only return this
redirect when the intended guard is set (e.g., check the same
ENABLE_DOCS_SUBDOMAIN_PROXY or DOCS_ORIGIN env var used by rewrites()), ensure
the redirect and the rewrites() proxy behavior are mutually exclusive (only one
path is active at a time), and change permanent: true to permanent: false (use
307) while validating to avoid hard-caching by browsers; adjust logic inside
redirects() to consult process.env and mirror the conditional used in rewrites()
so the redirect won’t run unguarded.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@apps/docs/next.config.mjs`:
- Around line 8-9: The current config sets basePath and assetPrefix (basePath:
'/docs', assetPrefix: 'https://docs.prisma.io') which will conflict with the
unconditional redirect in redirects() (the redirect that sends all traffic from
docs.prisma.io to prisma.io/docs) — asset requests will be redirected and
bundles won't load; either remove or adjust assetPrefix to point to the actual
static host where the app is served (e.g., the Vercel/prisma.io origin), or make
the redirect conditional so the app can serve assets at docs.prisma.io; update
next.config.mjs to ensure assetPrefix matches the real bundle host or remove the
unconditional redirect in redirects() so basePath and assetPrefix are consistent
with your intended deployment topology.
- Line 9: The current static basePath: '/docs' causes the app to only handle
/docs/* paths and breaks the subdomain proxy scenario; make basePath conditional
the same way rewrites() is gated. Update next.config.mjs to compute basePath
based on the same environment/flag used for rewrites() (e.g., an IS_ORIGIN_PROXY
or ENABLE_ORIGIN_PROXY env var) so that when the subdomain proxy mode is active
the config uses basePath: '' (or omits basePath) and when the origin deployment
is used it sets basePath: '/docs'; reference the existing basePath setting and
the rewrites() gating logic in next.config.mjs to implement the conditional.
apps/docs/next.config.mjs
Outdated
| /** @type {import('next').NextConfig} */ | ||
| const config = { | ||
| assetPrefix: 'https://docs.prisma.io', | ||
| basePath: '/docs', // if serving under /docs path |
There was a problem hiding this comment.
basePath: '/docs' breaks the subdomain proxy use case described in lines 16–18.
The comments on lines 16–18 describe a deployment mode where docs.prisma.io proxies all requests through this app via rewrites(). With basePath: '/docs', this app only handles requests under the /docs path prefix. That means:
docs.prisma.io/getting-started→ 404 (no/docsprefix, app won't handle it)docs.prisma.io/docs/getting-started→ matches, but that's not the desired URL structure for the subdomain
The subdomain proxy scenario assumes the app serves at /, not /docs. If basePath is needed for the prisma.io/docs deployment (where the website proxies /docs/* to this origin), you'll need to make basePath conditional — similar to how rewrites() is gated:
Sketch: conditional basePath
const config = {
- assetPrefix: 'https://docs.prisma.io',
- basePath: '/docs',
+ ...(process.env.ENABLE_DOCS_SUBDOMAIN_PROXY === '1'
+ ? {}
+ : { basePath: '/docs', assetPrefix: 'https://docs.prisma.io' }),This way the subdomain deployment serves at / and the origin deployment serves at /docs.
🤖 Prompt for AI Agents
In `@apps/docs/next.config.mjs` at line 9, The current static basePath: '/docs'
causes the app to only handle /docs/* paths and breaks the subdomain proxy
scenario; make basePath conditional the same way rewrites() is gated. Update
next.config.mjs to compute basePath based on the same environment/flag used for
rewrites() (e.g., an IS_ORIGIN_PROXY or ENABLE_ORIGIN_PROXY env var) so that
when the subdomain proxy mode is active the config uses basePath: '' (or omits
basePath) and when the origin deployment is used it sets basePath: '/docs';
reference the existing basePath setting and the rewrites() gating logic in
next.config.mjs to implement the conditional.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Chores