-
-
Notifications
You must be signed in to change notification settings - Fork 200
Description
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch [email protected] for the project I'm working on.
Problem
When using react-resizable-panels with Vite + React 19, I encountered a runtime error on pointer move:
Uncaught TypeError: Cannot read properties of undefined (reading 'CSSStyleSheet')
at ae (updateCursorStyle.ts:20:48)
at HTMLDocument.Le (onDocumentPointerMove.ts:64:7)
In src/utils/dom/updateCursorStyle.ts, the guard checks if (document.defaultView === null) but document.defaultView can be undefined in certain contexts (Vite HMR, SSR hydration). Since undefined !== null, the guard passes and crashes when accessing defaultView.CSSStyleSheet.
This appears related to PR #555 which addressed popup window support, but the fix was incomplete for the undefined case.
Suggested Fix
In src/utils/dom/updateCursorStyle.ts, change:
if (document.defaultView === null) return;to:
if (!document.defaultView) return;Here is the diff that solved my problem (applied to dist files):
- if (e.defaultView === null)
+ if (!e.defaultView)
return;