Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something wrong with RTLScroll, cannot read property 'insertBefore' of null #115

Closed
tadkondrat opened this issue Aug 26, 2019 · 9 comments
Closed

Comments

@tadkondrat
Copy link

What is the current behavior?

I tried to import as default scrollbar component but code got fault. Before received this, i made few another components with scrollbar and everything was fine. But now something wrong...

Uncaught TypeError: Cannot read property 'insertBefore' of null
at shouldReverseRTLScroll (rsc.esm.js?d884:388)
at Module.eval (rsc.esm.js?d884:909)
at eval (rsc.esm.js:1899)
at Module../node_modules/react-scrollbars-custom/dist/rsc.esm.js (application.js:8484)
at webpack_require (application.js:69)
at eval (CardsList.tsx:10)
at Module../webpack/app/Payment/View/Cards/CardsList.tsx (application.js:14944)
at webpack_require (application.js:69)
at eval (index.tsx:9)
at Module../webpack/app/Payment/View/Cards/index.tsx (application.js:14980)

My app code:

import Scrollbar from 'react-scrollbars-custom';

 return (
  <Scrollbar
         maximalThumbSize={0}
        style={{ height: props.height - 42, flex: "1" }}
        disableTracksWidthCompensation
        minimalThumbSize={0}
        noScrollX
        trackYProps={{
          renderer: props => {
            const { elementRef, ...restProps } = props
            return (
              <span
                {...restProps}
                style={{ width: 0 }}
                ref={elementRef}
                className="trackY"
              />
            )
          }
        }}
>
</Scrollbar>

A little about versions:

  • OS: Mac OS
  • Browser (vendor and version): Google Chrome 76.0.3809.100 (Official Build) (64-bit)
  • React: 16.8.4
  • react-scrollbars-custom: ^4.0.17
  • Did this worked in the previous package version?
@tadkondrat tadkondrat changed the title Bug? Something wrong with RTLScroll, cannot read property 'insertBefore' of null Something wrong with RTLScroll, cannot read property 'insertBefore' of null Aug 26, 2019
@xobotyi
Copy link
Owner

xobotyi commented Aug 26, 2019

@tadkondrat Oo weird!
try this sandbox: https://codesandbox.io/s/beautiful-haze-x4p0t is there errors?

@tadkondrat
Copy link
Author

@xobotyi No errors now

@xobotyi
Copy link
Owner

xobotyi commented Aug 26, 2019

>_>

xobotyi added a commit that referenced this issue Aug 26, 2019
@xobotyi
Copy link
Owner

xobotyi commented Aug 26, 2019

@tadkondrat i'm releasing v4.0.18 now - try to use it and report on any results please.

@tadkondrat
Copy link
Author

@xobotyi Got right now same error but with appendChild. Look like document is not loaded when i'm tried to render component. My react app starting after DOM loaded event...

Cannot read property 'appendChild' of null

@xobotyi
Copy link
Owner

xobotyi commented Aug 26, 2019

@tadkondrat Could you watch what the line, el.appendChild(child); or doc.body.appendChild(el); ?

@tadkondrat
Copy link
Author

@xobotyi doc.body.appendChild(el)
I insert my scripts after body and now its work fine.

Before

<html>
<scripts />
<body></body>
</html>

After

<html>
<body></body>
<scripts />
</html>

@xobotyi
Copy link
Owner

xobotyi commented Aug 26, 2019

Shall i close?

@tadkondrat
Copy link
Author

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants