Summary
Deleting or uploading a video in the VideoPress admin page (projects/packages/videopress/src/client/admin/) throws an uncaught TypeError from inside @base-ui/react@1.4.1's useMergedRefs / useRenderElement path. The React tree crashes and the admin becomes unresponsive.
Tracking: #48160 — Jetpack UI Modernization.
Reproduction
- Connect Jetpack on a fresh site (free tier — no VideoPress purchase, so the
UpgradeTrigger renders).
- Open the VideoPress admin (
wp-admin/admin.php?page=jetpack-videopress).
- Upload a video, or delete an existing one.
- React tree crashes; admin becomes unresponsive.
Reproduced on profoundly-select.jurassic.ninja, current trunk.
Stack — delete
TypeError: Cannot read properties of null (reading 'refs')
at didChange (@base-ui/utils/useMergedRefs.js)
at useMergedRefs
at useRenderElementProps (@base-ui/react/internals/useRenderElement.js)
at <UpgradeTrigger> in projects/packages/videopress/src/client/admin/components/admin-page/index.tsx (lines 248–256 on trunk)
Stack — upload (likely same root cause, different arm)
TypeError: Cannot read properties of undefined (reading 'length')
at useEffect callback in @base-ui/react internals
at mf (react-dom commit)
Bisect / suspected commit
27bf601935 — Componentry: migrate ContextualUpgradeTrigger to @wordpress/ui *Notice (*#48909).
Before this commit, UpgradeTrigger used ContextualUpgradeTrigger from @automattic/jetpack-components and did not pull @wordpress/ui (and transitively @base-ui/react) into the admin bundle. After it, every re-render of <UpgradeTrigger> runs through base-ui's ref-merge path. The crash reliably fires when hasVideos / hasUsedVideo flips on delete/upload.
Confirmation
Locally replaced the <Notice.Root> tree in admin-page/index.tsx with a plain <div> / <button> and rebuilt the videopress package. Both crashes disappeared.
Suggested fix options
- Revert
27bf601935's changes to projects/packages/videopress/src/client/admin/components/admin-page/index.tsx (keep the rest of the migration if other consumers in that commit are clean).
- Or replace just that
UpgradeTrigger Notice usage with ContextualUpgradeTrigger until the upstream base-ui behavior is resolved.
Environment
Summary
Deleting or uploading a video in the VideoPress admin page (
projects/packages/videopress/src/client/admin/) throws an uncaughtTypeErrorfrom inside@base-ui/react@1.4.1'suseMergedRefs/useRenderElementpath. The React tree crashes and the admin becomes unresponsive.Tracking: #48160 — Jetpack UI Modernization.
Reproduction
UpgradeTriggerrenders).wp-admin/admin.php?page=jetpack-videopress).Reproduced on
profoundly-select.jurassic.ninja, current trunk.Stack — delete
Stack — upload (likely same root cause, different arm)
Bisect / suspected commit
27bf601935— Componentry: migrateContextualUpgradeTriggerto@wordpress/ui*Notice (*#48909).Before this commit,
UpgradeTriggerusedContextualUpgradeTriggerfrom@automattic/jetpack-componentsand did not pull@wordpress/ui(and transitively@base-ui/react) into the admin bundle. After it, every re-render of<UpgradeTrigger>runs through base-ui's ref-merge path. The crash reliably fires whenhasVideos/hasUsedVideoflips on delete/upload.Confirmation
Locally replaced the
<Notice.Root>tree inadmin-page/index.tsxwith a plain<div>/<button>and rebuilt the videopress package. Both crashes disappeared.Suggested fix options
27bf601935's changes toprojects/packages/videopress/src/client/admin/components/admin-page/index.tsx(keep the rest of the migration if other consumers in that commit are clean).UpgradeTriggerNoticeusage withContextualUpgradeTriggeruntil the upstream base-ui behavior is resolved.Environment
@wordpress/ui@0.13.0→@base-ui/react@1.4.1