Skip to content

Conversation

@coltondotio
Copy link
Contributor

@coltondotio coltondotio commented Oct 31, 2025

Related:

Short description of the changes made

Fix typescript errors in:

  • packages/fern-dashboard/src/app/[orgName]/(visual-editor) (PageSidebar and PageNode)
  • packages/fern-docs/components/src/navigation

What was the motivation & context behind this PR?

Part of ongoing effort to bring fern-dashboard back to zero-error state. At some point our builds started to pass even with compiler warnings/errors.

How has this PR been tested?

N/A

@vercel
Copy link
Contributor

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dev.ferndocs.com Ready Ready Preview Nov 7, 2025 8:47pm
fern-dashboard Ready Ready Preview Nov 7, 2025 8:47pm
fern-dashboard-dev Ready Ready Preview Nov 7, 2025 8:47pm
ferndocs.com Ready Ready Preview Nov 7, 2025 8:47pm
preview.ferndocs.com Ready Ready Preview Nov 7, 2025 8:47pm
prod-assets.ferndocs.com Ready Ready Preview Nov 7, 2025 8:47pm
prod.ferndocs.com Ready Ready Preview Nov 7, 2025 8:47pm
1 Skipped Deployment
Project Deployment Preview Updated (UTC)
fern-platform Ignored Ignored Nov 7, 2025 8:47pm

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Two SerializableFoundNode object literals are missing the required currentVariant property, which will cause TypeScript compilation errors after this PR's changes add it to the type definition.

View Details
📝 Patch Details
diff --git a/packages/fern-docs/components/src/navigation/NavigationStore.ts b/packages/fern-docs/components/src/navigation/NavigationStore.ts
index 2ba7318e9..f1148ff19 100644
--- a/packages/fern-docs/components/src/navigation/NavigationStore.ts
+++ b/packages/fern-docs/components/src/navigation/NavigationStore.ts
@@ -304,6 +304,7 @@ export class NavigationStore {
             currentTab: tabSlug ? ({ slug: tabSlug } as any) : undefined,
             currentVersion: version,
             currentProduct: product,
+            currentVariant: undefined,
             isCurrentVersionDefault: false,
             isCurrentProductDefault: false
         };
@@ -588,6 +589,7 @@ export class NavigationStore {
                         currentTab: pageSearchResult.tabSlug ? ({ slug: pageSearchResult.tabSlug } as any) : undefined,
                         currentVersion: pageSearchResult.version,
                         currentProduct: pageSearchResult.product,
+                        currentVariant: undefined,
                         isCurrentVersionDefault: false,
                         isCurrentProductDefault: false
                     };
diff --git a/packages/fern-docs/components/src/navigation/__tests__/migrations.test.ts b/packages/fern-docs/components/src/navigation/__tests__/migrations.test.ts
index fa02cafc2..854c3e100 100644
--- a/packages/fern-docs/components/src/navigation/__tests__/migrations.test.ts
+++ b/packages/fern-docs/components/src/navigation/__tests__/migrations.test.ts
@@ -47,6 +47,7 @@ describe("migrations", () => {
                                 currentTab: undefined,
                                 currentVersion: undefined,
                                 currentProduct: undefined,
+                                currentVariant: undefined,
                                 isCurrentVersionDefault: true,
                                 isCurrentProductDefault: true
                             }

Analysis

Missing currentVariant property in SerializableFoundNode object literals causes TypeScript compilation errors

What fails: NavigationStore.ts contextForExtraction objects (lines 298, 582) and migrations test file (line 46) missing required currentVariant property for SerializableFoundNode type

How to reproduce:

cd packages/fern-docs/components && pnpm exec tsc --noEmit

Result: TypeScript compilation fails with errors:

  • src/navigation/NavigationStore.ts(298,15): error TS2741: Property 'currentVariant' is missing in type ... but required in type 'SerializableFoundNode'
  • src/navigation/NavigationStore.ts(582,27): error TS2741: Property 'currentVariant' is missing in type ... but required in type 'SerializableFoundNode'
  • src/navigation/__tests__/migrations.test.ts(26,29): error TS2741: Property 'currentVariant' is missing in type ... but required in type 'SerializableFoundNode'

Expected: TypeScript compilation should pass without errors. The SerializableFoundNode type definition includes currentVariant in its Pick type (line 25 in types.ts), so all object literals typed as SerializableFoundNode must include this property.

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Two SerializableFoundNode object literals are missing the required currentVariant field, which will cause TypeScript compilation errors since this field is now part of the type definition.

View Details
📝 Patch Details
diff --git a/packages/fern-docs/components/src/navigation/NavigationStore.ts b/packages/fern-docs/components/src/navigation/NavigationStore.ts
index 3ea91ec5c..0f4d85cd7 100644
--- a/packages/fern-docs/components/src/navigation/NavigationStore.ts
+++ b/packages/fern-docs/components/src/navigation/NavigationStore.ts
@@ -327,6 +327,7 @@ export class NavigationStore {
             currentTab: tabSlug ? ({ slug: tabSlug } as any) : undefined,
             currentVersion: version,
             currentProduct: product,
+            currentVariant: undefined,
             isCurrentVersionDefault: false,
             isCurrentProductDefault: false
         };
@@ -613,6 +614,7 @@ export class NavigationStore {
                         currentTab: pageSearchResult.tabSlug ? ({ slug: pageSearchResult.tabSlug } as any) : undefined,
                         currentVersion: pageSearchResult.version,
                         currentProduct: pageSearchResult.product,
+                        currentVariant: undefined,
                         isCurrentVersionDefault: false,
                         isCurrentProductDefault: false
                     };

Analysis

Missing currentVariant field in SerializableFoundNode object literals causes TypeScript compilation errors

What fails: Two SerializableFoundNode object literals in NavigationStore.ts (lines 321-332 and 607-618) are missing the required currentVariant field, causing TypeScript error "Property 'currentVariant' is missing in type"

How to reproduce:

pnpm exec tsc --noEmit packages/fern-docs/components/src/navigation/NavigationStore.ts

Result: TypeScript compilation fails with error TS2741 about missing currentVariant property

Expected: Should compile successfully like other SerializableFoundNode usages in migrations.ts and test files that include currentVariant: undefined

@vercel vercel bot temporarily deployed to Preview – prod-assets.ferndocs.com November 7, 2025 20:38 Inactive
@vercel vercel bot temporarily deployed to Preview – prod.ferndocs.com November 7, 2025 20:38 Inactive
@vercel vercel bot temporarily deployed to Preview – preview.ferndocs.com November 7, 2025 20:38 Inactive
@stephencme stephencme changed the title fix(docs): typescript errors fix(editor): TS warnings and errors from new variants field Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants