Uncaught (in promise) Error at PdfHighlighter.init
From time to time I get:
Uncaught (in promise) Error: ! at PdfHighlighter.init (react-pdf-highlighter.js?v=7deb8492:2123:13)
Thrown here:
if (!this.containerNodeRef.current) {
throw new Error("!");
}
Am I doing anything wrong?
Seems like a timing issue to me - checking containerNodeRef.current in init before ref is set in render
Getting this issue as well, do you know what might be causing this, maybe I'm not waiting for the component to mount?
Solution for me was to overwrite PdfHighlighter and add a little timeout to overcome the timing-issue.
https://gist.github.com/christophhalbi/40ce155e2bc326a1effafe746635a04a
Solution for me was to overwrite PdfHighlighter and add a little timeout to overcome the timing-issue.我的解决方案是覆盖 PdfHighlighter 并添加一点超时以克服计时问题。
https://gist.github.com/christophhalbi/40ce155e2bc326a1effafe746635a04a
I also found this problem. I was going to directly modify the source code to solve it. Your scheme is very Nice.