-
Notifications
You must be signed in to change notification settings - Fork 23
fix(editor): fail fast when docs.yml cannot be loaded #4895
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
Closed
devin-ai-integration
wants to merge
2
commits into
app
from
devin/1762543751-fix-editor-docs-yml-error-handling
Closed
fix(editor): fail fast when docs.yml cannot be loaded #4895
devin-ai-integration
wants to merge
2
commits into
app
from
devin/1762543751-fix-editor-docs-yml-error-handling
+10
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, when getDocsYmlAndReferences() failed (e.g., due to SITE_NOT_FOUND), the editor layout would log the error but continue rendering with null data. This caused downstream components to throw errors that were caught by the error boundary and displayed as the generic 'This file contains markdown that is not yet readable by the editor' message. Now, the layout throws a digestible error immediately when getDocsYmlAndReferences() fails, which is caught by the [docsUrl]/error.tsx boundary and displays the appropriate error message (e.g., 'Your repository contains one or more Fern projects, but is missing a valid instance URL'). This makes the failure deterministic and provides users with clear, actionable error messages instead of confusing generic errors. Co-Authored-By: [email protected] <[email protected]>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
packages/fern-dashboard/src/app/[orgName]/(visual-editor)/editor/[docsUrl]/[branch]/layout.tsx
Show resolved
Hide resolved
Add DOCS_YML_MISSING to ERROR_DIGEST_KEYS and ERROR_DIGEST_MESSAGES to prevent users from seeing 'Unknown error occurred' when docs.yml is missing from their repository. Addresses Vercel Agent Review feedback. Co-Authored-By: [email protected] <[email protected]>
dsinghvi
approved these changes
Nov 7, 2025
Contributor
Author
|
Closing as the issue was resolved through a different approach: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://buildwithfern.slack.com/archives/C071SHP6UAY/p1762542385100039
Fail fast when docs.yml cannot be loaded in editor
Previously, when
getDocsYmlAndReferences()failed (e.g., due to SITE_NOT_FOUND, DOCS_YML_MISSING, or transient GitHub API issues), the editor layout would log the error but continue rendering withlatestDocsYmlAndReferences = null. This caused downstream components to throw errors that were caught by the error boundary and displayed as the generic "This file contains markdown that is not yet readable by the editor" message.Now, the layout throws a digestible error immediately when
getDocsYmlAndReferences()fails. This error is caught by the[docsUrl]/error.tsxboundary, which displays the appropriate error message (e.g., "Your repository contains one or more Fern projects, but is missing a valid instance URL") with "Return home" and "Try again" buttons.Additionally, added the missing
DOCS_YML_MISSINGerror message to prevent users from seeing "Unknown error occurred" when docs.yml is missing.What was the motivation & context behind this PR?
Customers reported seeing confusing error messages when accessing the Fern Editor:
Investigation revealed that the layout was continuing to render with null data when GitHub API calls failed, causing a cascade of errors downstream. The fix makes failures deterministic and provides clear, actionable error messages.
How has this PR been tested?
Key Review Areas
[docsUrl]/error.tsxproperly catches and displays all possible error digest types (SITE_NOT_FOUND, DOCS_YML_MISSING, NO_PROJECTS, REPO_NOT_FOUND, etc.)latestDocsYmlAndReferencesdocsYmlAndReferences.resultdirectly - verify TypeScript compiles this correctly via control flow analysisKnown Limitations
This PR improves error messaging but does not address the underlying intermittent GitHub API failures that cause errors like SITE_NOT_FOUND. Future improvements could include retry logic for transient failures.
Link to Devin run: https://app.devin.ai/sessions/c9b3ead2dfbf4f18a0619e25ecd94970
Requested by: [email protected]