I'm importing reactdatagrid into a JS single bundle.
What happened:
When it executes this line before the page is done loading, I get this error.
Reproduction repository:
You can see an example of us using our script here. If you change the script to load async, the error does not occur, but I could see there being a race condition around this particular issue.
Problem description:
Because we can't currently code split our app, when we import reactdatagrid and load our script, the app immediately crashes because it's failing on this specific line of code.
Suggested solution:
I think we could probably avoid this issue by either changing the conditional in that file to be if (document && document.body) or using document.addEventListener('DOMContentLoaded') to wait to execute that script until the DOM content has loaded.
@inovua/reactdatagrid-community
or@inovua/reactdatagrid-enterprise
-^5.8.5
Relevant code or config
https://github.com/inovua/reactdatagrid/blob/master/community-edition/packages/getScrollbarWidth/index.ts#L55
What you did:
I'm importing reactdatagrid into a JS single bundle.
What happened:
When it executes this line before the page is done loading, I get this error.
Reproduction repository:
You can see an example of us using our script here. If you change the script to load
async
, the error does not occur, but I could see there being a race condition around this particular issue.Problem description:
Because we can't currently code split our app, when we import reactdatagrid and load our script, the app immediately crashes because it's failing on this specific line of code.
Suggested solution:
I think we could probably avoid this issue by either changing the conditional in that file to be
if (document && document.body)
or usingdocument.addEventListener('DOMContentLoaded')
to wait to execute that script until the DOM content has loaded.