Skip to content

[repo:objectui] page:header crashes with React #31 when the record's name field is empty — the title fallback picks a lookup field and renders its expanded record object as a JSX child #10117

Description

@os-sam

Moved from objectstack-ai/objectstack#14888 by the triage seat (session_01KYzNJPin9Ar4oMMkSh4S9h), under the ruling on objectstack-ai/objectstack#17250 (letter A — a card lives in the repo its fix lands in) and the maintainer's 2026-09-20 approval of the hybrid split.
Recreated rather than transferred because GitHub's issue transfer exists only in GraphQL (POST /graphql answers 403 from a Claude Code session) and the REST API has no transfer endpoint (404) — measured, not assumed.
Nothing in the original text below was changed except two mechanical edits the cross-repo rule requires: bare #N references were qualified to objectstack-ai/objectstack#N so they keep pointing where they pointed, and (where present) the Blocked-by: objectstack-ai/objectstack#17250 line was dropped — that blocker was 「don't work this until we know which repo owns it」, and this move is the answer to it.
Original filer: baozhoutao, 2026-09-03T07:53:04Z. The source card is closed duplicate pointing here.


Summary

The record page's page:header block crashes with Minified React error objectstack-ai/objectstack#31 ("Objects are not valid as a React child") when the record's name field is empty. The header falls back to another candidate title field — here the subject lookup — and renders its expanded lookup object ({id, name, code, kind, parent_business_unit_id, organization_id, manager_user_id, active, effective_from, effective_to, external_ref, …}) directly as a child. The whole header is replaced by the red "Component "page:header" failed to render … Retry" panel; the rest of the page renders.

Minimal reproduction

Platform 17.2.0 console.

Object kpi_entry_sheet: nameField: 'name', name: Field.text({ readonly: true }), subject: Field.lookup('sys_business_unit', { required: true }).

  1. Create a record whose name is null (any path — REST POST /api/v1/data/kpi_entry_sheet {"plan": "...", "subject": "bu_east", "subject_type": "department"} is enough; name is not required).
  2. Open /_console/apps/<app>/kpi_entry_sheet/record/<id>.

Observed:

Component "page:header" failed to render
Minified React error #31; args[]=object with keys {id, created_at, updated_at, created_by, updated_by, name, code, kind, parent_business_unit_id, organization_id, manager_user_id, active, effective_from, effective_to, external_ref}

Console: Error: Minified React error #31 … vendor-react-*.js. The breadcrumb, which resolves the same record, shows 华东分公司 (the lookup's display name) correctly — so the display value is available; the header just does not use it.

Control: the same object with a non-empty name renders the header normally.

Where (as far as the minified bundle shows)

plugins-views chunk — the title-field chooser tries nameField / displayNameField, then walks ['name','full_name','title','subject','display_name']. When the chosen field's value is empty the header ends up with the next candidate's raw value; for a lookup that value is the expanded record object, which is handed to JSX unchanged.

Expected

  • A lookup / reference value used as a title must go through the same display-value resolution the breadcrumb and grid cells use (name / displayField of the target object), never be rendered raw.
  • An empty title should degrade to a placeholder ( or the record id), not to a different field's raw value, and certainly not to a crash of the whole header block.
  • Defensive: page:header should stringify any non-string title candidate before rendering.

Environment

@objectstack/console 17.2.0 · objectstack dev · Chrome. App: objectstack-ai/kpi, object kpi_entry_sheet (record created manually by an admin, so its hook-computed name was never filled).


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions