plans/issues/issue-2777.md
Executor instructions: Follow step by step; run the drift check first. Update the status row for this plan in
plans/issues/README.mdwhen done.Drift check (run first):
gh api repos/motiondivision/motion/issues/2777 --jq .state→ expect"open". If already closed, mark this plan DONE and stop.
42bfbe3ed, 2026-06-11Reported 2024-08-29, 0 comments, no CodeSandbox (the template's "Without
one, this bug report won't be accepted" line is still in the body). The user
wraps NextUI v1's Button (@nextui-org/react) in React.forwardRef and
passes it to motion(...); rendering throws:
TypeError: Cannot convert undefined or null to object
at Function.assign ← Object.assign(...)
at HTMLVisualElement.renderHTML [as renderInstance] (render.mjs:6:12)
Analysis against the working tree:
renderHTML which used
Object.assign(element.style, style). Current
packages/motion-dom/src/render/html/utils/render.ts:10-15 no longer calls
Object.assign; it assigns style keys in a loop. The reported error
as written cannot occur on motion@12..style (a component instance or a non-DOM "DOMRef" object, which NextUI
v1 used in places) — would still crash today, just with a different message
(Cannot set properties of undefined). VisualElement.mount(instance) and
renderHTML do not guard against non-Element instances.Repo policy: no repro → no fix, and no speculative defensive guards landed
without a failing test. If a repro materialises on motion@12, the likely fix
shape is a dev-only invariant in VisualElement.mount (warn when instance
is not an Element) rather than guards inside renderHTML's hot path — note
this for the future, do not implement now.
Open plans/issues/README.md, find the issue-2777 row. If not APPROVED, mark
this plan BLOCKED and stop.
gh api repos/motiondivision/motion/issues/2777/comments -f body="Closing as this never received the minimal reproduction the template requires, and the stack trace points at a code path (Object.assign in renderHTML) that no longer exists in motion@12. The error means the ref your wrapper forwarded did not resolve to a DOM element — motion components need the ref to reach the underlying DOM node. NextUI v1 is unmaintained now; if you (or anyone) can reproduce a crash like this with motion@12 and a current UI library, please open a new issue with a CodeSandbox/StackBlitz and we'll take a look."
gh api -X PATCH repos/motiondivision/motion/issues/2777 -f state=closed -f state_reason=not_planned
Verify: gh api repos/motiondivision/motion/issues/2777 --jq .state → "closed".
not_planned (only after APPROVED)plans/issues/README.md status row updated