react-native-autoheight-webview icon indicating copy to clipboard operation
react-native-autoheight-webview copied to clipboard

Cannot read properties of undefined (reading 'getBoudningClientRect')

Open pro-vi opened this issue 2 years ago • 2 comments

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:

  • OS: Android
  • OS version: Android 12
  • react-native version: 0.68.2
  • react-native-webview version: 11.23.0
  • react-native-autoheight-webview version: 1.6.4

pro-vi avatar Sep 02 '22 22:09 pro-vi

Please provide your uri source.

iou90 avatar Sep 05 '22 06:09 iou90

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.

pro-vi avatar Sep 06 '22 17:09 pro-vi