vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

I ran into an exception due to null

Open shi-yan opened this issue 11 months ago • 2 comments

https://github.com/TaTo30/vue-pdf/blob/fbdaf443cb510f1144d83e370270fec163b33599/packages/vue-pdf/src/components/layers/AnnotationLayer.vue#L129

the above line caused : Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'F.value.addEventListener')

Screenshot 2025-01-02 at 8 07 30 PM Screenshot 2025-01-02 at 8 07 17 PM

I think there might be some race condition.

shi-yan avatar Jan 03 '25 02:01 shi-yan

You can put your code in a nextTick or Vue lifecycle hook.

vordimous avatar Feb 25 '25 13:02 vordimous

I think there might be some race condition.

It seems that the <div> element that contains the annotations was removed before finishing the render task.

I cannot reproduce this, I'd appreciate if you can share a sample code.

TaTo30 avatar Mar 21 '25 04:03 TaTo30