Skip to content

fix: resolve CI build errors in types, console, and fields packages#1154

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-ci-build-and-test-errors-another-one
Mar 31, 2026
Merged

fix: resolve CI build errors in types, console, and fields packages#1154
hotlong merged 2 commits intomainfrom
copilot/fix-ci-build-and-test-errors-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Three independent build failures on main: a type incompatibility in ChatbotSchema, a missing type assertion in ObjectManagerPage, and a bundled react/jsx-runtime breaking Next.js SSR.

  • @object-ui/typesChatbotSchema.body: Record<string, unknown> conflicts with BaseSchema.body: SchemaNode | SchemaNode[]. Renamed to requestBody since it represents HTTP request params, not child schema nodes.

  • apps/consoleObjectManagerPage.toFieldDefinition() assigns field.type (string) to DesignerFieldType (literal union). Added type assertion and missing import:

    type: (field.type || 'text') as DesignerFieldType,
  • @object-ui/fieldsreact/jsx-runtime was not externalized in vite config, causing it to be bundled into the CJS output. Next.js Turbopack SSR rejects the resulting dynamic require() during static prerendering of /docs/components/overlay/tooltip. Added react/jsx-runtime to externals, matching the pattern in plugin-list/plugin-detail.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

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

Project Deployment Actions Updated (UTC)
objectui-demo Ready Ready Preview, Comment Mar 31, 2026 6:31am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Mar 31, 2026 6:31am
objectui-storybook Ignored Ignored Mar 31, 2026 6:31am

Request Review

- Fix TS2430: Rename ChatbotSchema.body to requestBody to avoid conflict with BaseSchema.body
- Fix TS2322: Add type assertion for DesignerFieldType in ObjectManagerPage.tsx
- Fix SSR: Add react/jsx-runtime to fields package vite externals for Next.js compatibility
- Update CHANGELOG.md

Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/f91e232a-9e03-48ed-9599-fcc920e1e008

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix all CI build and test errors fix: resolve CI build errors in types, console, and fields packages Mar 31, 2026
Copilot AI requested a review from xuyushun441-sys March 31, 2026 06:34
@hotlong hotlong marked this pull request as ready for review March 31, 2026 06:36
Copilot AI review requested due to automatic review settings March 31, 2026 06:36
@hotlong hotlong merged commit ab815c8 into main Mar 31, 2026
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Resolves multiple CI build failures across the monorepo by aligning schema types, fixing a console type error, and adjusting Vite externals for Next.js SSR compatibility.

Changes:

  • Renames ChatbotSchema.bodyChatbotSchema.requestBody to avoid conflicting with BaseSchema.body (child schema nodes) and updates plugin-chatbot renderer usage.
  • Fixes a DesignerFieldType assignment error in the console ObjectManagerPage by importing the type and asserting the field type.
  • Externalizes react/jsx-runtime in @object-ui/fields Vite config to prevent SSR failures in Next.js/Turbopack docs builds.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/types/src/complex.ts Renames chatbot schema request payload field to requestBody to resolve BaseSchema.body type conflict.
packages/plugin-chatbot/src/renderer.tsx Updates renderer wiring to pass schema.requestBody into useObjectChat/components.
packages/fields/vite.config.ts Externalizes react/jsx-runtime (and adds globals mapping) to avoid bundling SSR-hostile CJS wrappers.
apps/console/src/pages/system/ObjectManagerPage.tsx Fixes DesignerFieldType assignment with import + assertion.
CHANGELOG.md Documents the fixes and schema field rename.

Comment on lines 528 to 532
/**
* Additional body parameters to include with each API request.
*/
body?: Record<string, unknown>;
requestBody?: Record<string, unknown>;
/**
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

ChatbotSchema was renamed to requestBody, but the runtime Zod validator for Chatbot still defines an API body field (and overrides BaseSchema.body). This leaves validation/JSON-schema behavior inconsistent with the TypeScript interface and reintroduces the same conceptual conflict at runtime (child nodes vs HTTP body params). Update the Zod ChatbotSchema to use requestBody (and keep BaseSchema.body for child schema nodes) so validated schemas match the published types.

Copilot uses AI. Check for mistakes.
@@ -528,7 +528,7 @@ export interface ChatbotSchema extends BaseSchema {
/**
* Additional body parameters to include with each API request.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The JSDoc still refers to “body parameters” even though the property was renamed to requestBody. Consider updating the wording to “request body parameters” (or similar) to avoid confusion with BaseSchema.body (child nodes).

Suggested change
* Additional body parameters to include with each API request.
* Additional request body parameters to include with each API request.

Copilot uses AI. Check for mistakes.
Comment on lines 57 to 61
model: schema.model,
streamingEnabled: schema.streamingEnabled,
headers: schema.headers,
body: schema.body,
body: schema.requestBody,
maxToolRoundtrips: schema.maxToolRoundtrips,
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

requestBody is a breaking rename from the previously documented body schema field. If existing saved schemas may still send body as request params, consider adding a backward-compatible fallback (e.g., treat schema.body as request params when it’s a plain object rather than a SchemaNode) so older configs continue working while migrating to requestBody.

Copilot uses AI. Check for mistakes.
Comment on lines 104 to 107
name: field.name || '',
label: typeof field.label === 'object' ? field.label.defaultValue || field.label.key || '' : (field.label || field.name || ''),
type: field.type || 'text',
type: (field.type || 'text') as DesignerFieldType,
group: field.group || undefined,
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Casting field.type to DesignerFieldType bypasses type safety without ensuring the value is actually one of the supported field types. Since this comes from loose API metadata (type?: string), it would be safer to validate/narrow the value (e.g., via a small type guard / allowlist) and fall back to 'text' when unknown, instead of asserting.

Copilot uses AI. Check for mistakes.
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