Fix MDX component type incompatibility with React 19#524
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ibility Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add logging functionality to the application
Fix MDX component type incompatibility with React 19
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TypeScript compilation error that was causing Vercel builds to fail due to React 19's updated type definitions. React 19's FC type now returns ReactNode | Promise<ReactNode> to support Server Components, which conflicts with @types/mdx@2.0.13's expectation of just ReactNode. Additionally, it cleans up an empty documentation stub for the contracts module.
Changes:
- Added type assertion
as MDXComponentsto resolve React 19 type incompatibility in MDX component configuration - Removed empty
meta.jsonfile for contracts documentation (contracts module contains TypeScript interfaces, not Zod schemas requiring documentation)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/docs/mdx-components.tsx | Added type assertion to fix React 19 FC type incompatibility with @types/mdx |
| content/docs/references/contracts/meta.json | Removed empty meta.json file since contracts module has no generated documentation |
Comments suppressed due to low confidence (1)
content/docs/references/contracts/meta.json:1
- While deleting this empty
meta.jsonfile is correct since no documentation exists for the contracts module (it contains TypeScript interfaces, not Zod schemas), the parentcontent/docs/references/meta.jsonfile still references "contracts" in its pages array. This will likely cause a broken navigation link since the contracts directory doesn't exist. Consider removing "contracts" from the parent meta.json's pages array in a follow-up commit or updating this PR to include that change.
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
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.
Vercel builds failing with TypeScript error in
mdx-components.tsx. React 19'sFCtype returnsReactNode | Promise<ReactNode>for Server Component support, but@types/mdxexpectsReactNode.Changes
as MDXComponentstouseMDXComponentsreturn valueType assertion is safe—fumadocs components are MDX-compatible at runtime, structural typing ensures shape correctness.
Original prompt
18:00:53.617 Running build in Washington, D.C., USA (East) – iad1
18:00:53.617 Build machine configuration: 4 cores, 8 GB
18:00:53.721 Cloning github.com/objectstack-ai/spec (Branch: copilot/add-logging-functionality, Commit: 7c81d37)
18:00:54.565 Cloning completed: 844.000ms
18:00:55.832 Restored build cache from previous deployment (GAnvNjuAfCLLyPPuEpAEGDyGdJeK)
18:00:56.164 Warning: Detected "engines": { "node": ">=18.0.0" } in your
package.jsonthat will automatically upgrade when a new major Node.js Version is released. Learn More: https://vercel.link/node-version18:00:56.164 Running "vercel build"
18:00:57.834 Vercel CLI 50.10.2
18:00:58.112 Warning: Detected "engines": { "node": ">=18.0.0" } in your
package.jsonthat will automatically upgrade when a new major Node.js Version is released. Learn More: https://vercel.link/node-version18:00:58.171 Detected
pnpm-lock.yamlversion 9 generated by pnpm@10.x with package.json#packageManager pnpm@10.28.118:00:58.208 Installing dependencies...
18:01:00.432 Scope: all 26 workspace projects
18:01:00.709 ../.. | -2 -
18:01:01.886
18:01:01.977 ╭ Warning ─────────────────────────────────────────────────────────────────────╮
18:01:01.977 │ │
18:01:01.977 │ Ignored build scripts: @nestjs/core@10.4.22. │
18:01:01.977 │ Run "pnpm approve-builds" to pick which dependencies should be allowed │
18:01:01.977 │ to run scripts. │
18:01:01.978 │ │
18:01:01.978 ╰──────────────────────────────────────────────────────────────────────────────╯
18:01:01.983 Done in 1.9s using pnpm v10.28.1
18:01:02.009 Detected Next.js version: 16.1.6
18:01:02.036 Running "pnpm run build"
18:01:02.632
18:01:02.632 > @objectstack/docs@1.0.4 build /vercel/path0/apps/docs
18:01:02.632 > pnpm --filter @objectstack/spec gen:docs && next build
18:01:02.633
18:01:02.980
18:01:02.980 > @objectstack/spec@1.0.4 gen:docs /vercel/path0/packages/spec
18:01:02.980 > tsx scripts/build-docs.ts
18:01:02.980
18:01:03.393 Building documentation...
18:01:03.410 ✓ Generated ai/plugin-development.mdx
18:01:03.411 ✓ Generated ai/agent.mdx
18:01:03.411 ✓ Generated ai/cost.mdx
18:01:03.412 ✓ Generated ai/runtime-ops.mdx
18:01:03.412 ✓ Generated ai/orchestration.mdx
18:01:03.413 ✓ Generated ai/agent-action.mdx
18:01:03.414 ✓ Generated ai/devops-agent.mdx
18:01:03.415 ✓ Generated ai/rag-pipeline.mdx
18:01:03.415 ✓ Generated ai/conversation.mdx
18:01:03.416 ✓ Generated ai/nlq.mdx
18:01:03.416 ✓ Generated ai/predictive.mdx
18:01:03.416 ✓ Generated ai/feedback-loop.mdx
18:01:03.418 ✓ Generated ai/model-registry.mdx
18:01:03.429 ✓ Generated api/websocket.mdx
18:01:03.430 ✓ Generated api/analytics.mdx
18:01:03.430 ✓ Generated api/discovery.mdx
18:01:03.430 ✓ Generated api/documentation.mdx
18:01:03.431 ✓ Generated api/registry.mdx
18:01:03.431 ✓ Generated api/endpoint.mdx
18:01:03.431 ✓ Generated api/contract.mdx
18:01:03.432 ✓ Generated api/metadata.mdx
18:01:03.432 ✓ Generated api/auth.mdx
18:01:03.432 ✓ Generated api/protocol.mdx
18:01:03.434 ✓ Generated api/batch.mdx
18:01:03.434 ✓ Generated api/rest-server.mdx
18:01:03.435 ✓ Generated api/hub.mdx
18:01:03.435 ✓ Generated api/http-cache.mdx
18:01:03.435 ✓ Generated api/storage.mdx
18:01:03.436 ✓ Generated api/errors.mdx
18:01:03.436 ✓ Generated api/graphql.mdx
18:01:03.436 ✓ Generated api/view.mdx
18:01:03.437 ✓ Generated api/odata.mdx
18:01:03.437 ✓ Generated api/realtime.mdx
18:01:03.437 ✓ Generated api/connector.mdx
18:01:03.437 ✓ Generated api/router.mdx
18:01:03.437 ✓ Generated api/identity.mdx
18:01:03.440 ✓ Generated automation/approval.mdx
18:01:03.440 ✓ Generated automation/trigger-registry.mdx
18:01:03.441 ✓ Generated automation/connector.mdx
18:01:03.441 ✓ Generated automation/workflow.mdx
18:01:03.441 ✓ Generated automation/sync.mdx
18:01:03.442 ✓ Generated automation/etl.mdx
18:01:03.442 ✓ Generated automation/flow.mdx
18:01:03.442 ✓ Generated automation/webhook.mdx
18:01:03.443 Warning: Schema directory /vercel/path0/packages/spec/json-schema/contracts does not exist
18:01:03.450 ✓ Generated data/field.mdx
18:01:03.451 ✓ Generated data/query.mdx
18:01:03.451 ✓ Generated data/driver-nosql.mdx
18:01:03.451 ✓ Generated data/analytics.mdx
18:01:03.452 ✓ Generated data/object.mdx
18:01:03.452 ✓ Generated data/validation.mdx
18:01:03.452 ✓ Generated data/filter.mdx
18:01:03.453 ✓ Generated data/data-engine.mdx
18:01:03.453 ✓ Generated data/driver-sql.mdx
18:01:03.453 ✓ Generated data/dataset.mdx
18:01:03.457 ✓ Generated data/datasource.mdx
18:01:03.457 ✓ Generated data/document.mdx
18:01:03.457 ✓ Generated data/driver.mdx
18:01:03.457 ✓ Generated data/external-lookup.mdx
18:01:03.457 ✓ Generated data/mapping.mdx
18:01:03.457 ✓ Generated data/hook.mdx
18:01:03.457 ✓ ...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.