EasyUI Forum

General Category => EasyUI for React => Topic started by: chrwei on May 27, 2022, 09:32:31 AM



Title: error: null is not an object (evaluating 'this.view2.body')
Post by: chrwei on May 27, 2022, 09:32:31 AM
recently upgraded to react 18.1.0 and rc-easyui 1.2.6 and got this error in my log. I have an ErrorBoundary setup that captures errors and send them to my sever.

I have not been able to reproduce it, but I think the user has a mac and I don't have access to one at the moment. user agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15

maybe relayed, I'm also getting "Cannot read properties of null (reading 'body')" that I can reproduce, but as far as I can tell that one isn't coming from jeasyui.  "this.view2.body" is pretty clearly from your datagrid.  I'm seeing it on only 2 of my pages, and both use groupField/renderGroup.  I have not seen it on pages that have datagrids that aren't grouped.


Title: Re: error: null is not an object (evaluating 'this.view2.body')
Post by: chrwei on May 27, 2022, 09:46:24 AM
more errors logged as i posted this

one from another mac user, same user agent

several other users, slightly different error, all firefox

"error: this.view2 is null "
user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0



Title: Re: error: null is not an object (evaluating 'this.view2.body')
Post by: chrwei on May 27, 2022, 09:58:36 AM
oddly, if I tell the ErrorBoundery to not treat these as error, everything renders fine anyway.

I'm using @apollo/client 3.6.5 to provide the grid "data".  I was using 3.3.14 before. maybe related. looking at the network tab in devtools everything seems to be as I'd expect, no null results


Title: Re: error: null is not an object (evaluating 'this.view2.body')
Post by: chrwei on May 27, 2022, 11:29:13 AM
another from user agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36

Cannot read property 'body' of null


I'm pretty sure these are all the same error, I do see some null check on view2, but not everywhere.  I still can't figure why it's null, or at what point.  I'm also not sure how view2 relates to my data or code.


Title: Re: error: null is not an object (evaluating 'this.view2.body')
Post by: chrwei on June 10, 2022, 06:23:58 AM
think i found the issue.  In the GridColumn's render I'm using a lazy load, that component has to separately be wrapped in a Suspense to avoid the error.  I do have my <App /> wrapped in a Suspense, but it seems GridColumn is breaking out of that somehow