feat: add static fallback error page for Kratos - #2698
Conversation
There was a problem hiding this comment.
🟢 Ready to approve
The static asset routing aligns with the repo’s /docs/ baseUrl and Vercel cleanUrls: true, and no remaining references to the removed MDX route were found.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR replaces the Docusaurus-rendered Kratos fallback error page with a plain static HTML file to reduce payload and improve Core Web Vitals for the high-traffic route /docs/kratos/fallback/error.
Changes:
- Added a static HTML fallback page at
src/static/kratos/fallback/error.htmlto be served with Vercel clean URLs. - Removed the Docusaurus doc page
docs/kratos/fallback/error.mdxto avoid route/output conflicts.
File summaries
| File | Description |
|---|---|
| src/static/kratos/fallback/error.html | Adds a standalone, light-only static HTML page (inline CSS) for the fallback error route. |
| docs/kratos/fallback/error.mdx | Removes the Docusaurus MDX version so the static asset can take precedence for the same path. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
📝 WalkthroughWalkthroughAdds a static Kratos fallback error page with responsive inline styling, configuration guidance for ChangesFallback error UI
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: 1
🤖 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 `@src/static/kratos/fallback/error.html`:
- Around line 247-252: Update the copy-paste configuration example in the error
fallback snippet to use an HTTPS URL for selfservice.flows.error.ui_url,
changing the example endpoint from http://my-app.com/error to
https://my-app.com/error.
🪄 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 Plus
Run ID: 0991219e-e8cd-4cfa-8696-322f898c997e
⛔ Files ignored due to path filters (1)
docs/kratos/fallback/error.mdxis excluded by!**/*.mdx
📒 Files selected for processing (1)
src/static/kratos/fallback/error.html
| <div class="snippet"> | ||
| <div class="snippet__title">path/to/kratos/config.yml</div> | ||
| <pre tabindex="0"><code><span class="key">selfservice</span>: | ||
| <span class="key">flows</span>: | ||
| <span class="key">error</span>: | ||
| <span class="key">ui_url</span>: http://my-app.com/error</code></pre> |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Use HTTPS in the copy-paste configuration example.
http://my-app.com/error looks like a production endpoint and encourages sending the error identifier over plaintext. Change it to https://my-app.com/error, or make the example explicitly local with an http://localhost/... URL.
Proposed fix
- <span class="key">ui_url</span>: http://my-app.com/error</code></pre>
+ <span class="key">ui_url</span>: https://my-app.com/error</code></pre>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <div class="snippet"> | |
| <div class="snippet__title">path/to/kratos/config.yml</div> | |
| <pre tabindex="0"><code><span class="key">selfservice</span>: | |
| <span class="key">flows</span>: | |
| <span class="key">error</span>: | |
| <span class="key">ui_url</span>: http://my-app.com/error</code></pre> | |
| <div class="snippet"> | |
| <div class="snippet__title">path/to/kratos/config.yml</div> | |
| <pre tabindex="0"><code><span class="key">selfservice</span>: | |
| <span class="key">flows</span>: | |
| <span class="key">error</span>: | |
| <span class="key">ui_url</span>: https://my-app.com/error</code></pre> |
🤖 Prompt for 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.
In `@src/static/kratos/fallback/error.html` around lines 247 - 252, Update the
copy-paste configuration example in the error fallback snippet to use an HTTPS
URL for selfservice.flows.error.ui_url, changing the example endpoint from
http://my-app.com/error to https://my-app.com/error.
Related Issue or Design Document
Serves
/docs/kratos/fallback/erroras plain static HTML instead of a Docusaurus page.src/static/kratos/fallback/error.htmldocs/kratos/fallback/error.mdx. Required, not cleanup: both build to the same path and the Docusaurus output silently wins.src/css/theme.cssandWelcomeFooter.tsx.Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Further comments
Check out preview here - https://docs-git-feat-static-kratos-fallback-error-page-ory.vercel.app/docs/kratos/fallback/error
Summary by CodeRabbit