iou90 / react-native-autoheight-webview

An auto height webview for React Native
ISC License
492 stars 162 forks source link

Cannot read properties of undefined (reading 'getBoudningClientRect') #243

Closed pro-vi closed 1 year ago

pro-vi commented 2 years ago

Bug description: Upon rendering the WebView using a uri source, an error pops up Cannot read properties of undefined (reading 'getBoudningClientRect')

In WebView I'm using server-rendered react with nestJS. Upon examining the code I see that the package is trying to wrap each individual element in a wrapper div, but in this case the wrapper is undefined. This error only happens few seconds after the WebView has been rendered.

Environment:

iou90 commented 2 years ago

Please provide your uri source.

pro-vi commented 2 years ago

Please provide your uri source.

As of now, it is a local endpoint. Will let you know once it's accessible. But here's what's happening in the uri:

An editor based on lexical (https://playground.lexical.dev/) which uses ContentEditable under the hood (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable)

I was able to reproduce the error on a page without ContentEditable by triggering a height update. So more likely an issue with next.js? Also, this error doesn't affect the normal function - autoheight still works well despite of the error showing. The error is suppressed on production environment.