Uncaught TypeError: Cannot read property 'querySelectorAll' of undefined
When I try to use it in my React app, I get this error:

I made
import {OverlayScrollbars} from 'overlayscrollbars/js/OverlayScrollbars';
and after mounting all page try this: OverlayScrollbars(document.querySelectorAll('body'), { });
body element is available in this moment and logging into console:

After this error occurs, can you initialize a instance of the plugin manually via the console, or will this error show up again? Is it somehow possible to upload a small demo of your project? - It would make it easier for me to fix the issue.
My knowledge with react isn't very good, so I can only guess the error. I'll investigate on this and I'll send tomorrow possible fixes. Please test them and give me feedback if these fixes are working properly or not.
I am sorry, that your experience with my plugin wasn't as good as it should be.
Similar problem in another plugins: https://github.com/wallabyjs/public/issues/808 https://github.com/akiran/react-highlight/issues/39
I think it is context problem and when I used in your code global.document instead of window,document then error was missing.
May be this plugin will be useful: https://www.npmjs.com/package/global
Please try out this fix, maybe it will work: https://raw.githubusercontent.com/KingSora/KingSora.github.io/master/%238fix.js
This fix is working when I do import like this import 'overlayscrollbars/js/OverlayScrollbars';
When I try import by this way import OverlayScrollbars from 'overlayscrollbars/js/OverlayScrollbars'; I get empty importing object:
On this way: import {OverlayScrollbars} from 'overlayscrollbars/js/OverlayScrollbars'; I get undefined object:

Alright, we're getting closer... please try this: https://raw.githubusercontent.com/KingSora/KingSora.github.io/master/%238fix.js
This way is working now: import OverlayScrollbars from 'overlayscrollbars/js/OverlayScrollbars';. Thank you!
Yes! I am glad this bug is fixed now. I'll update the Github repo and the NPM repo later today. The version which will contain this (and some other fixes) will have the version 1.2.3.
Thank you for your cooperation! :)
Here you go: https://github.com/KingSora/OverlayScrollbars/releases/tag/v1.2.3 NPM is also updated: https://www.npmjs.com/package/overlayscrollbars
@asparkam Could you share your React integration? Also using React, and wondering how well this plugin works with React?