Why do my app crash with "Cannot read properties of null (reading 'sendWithPromise')" when uploading a file to a PDF component for the second time?

I want to give the user a mean to upload and display a PDF component, and change the file if it turns out to be the wrong one. This works the first time the user upload a file, but the second time the app crashes with the error message : “Cannot read properties of null (reading ‘sendWithPromise’)”
I have the following settings :

And the PDF component is set to show the file content url of the temp file object.
Can anyone explain why the app is crashing?

Hi Lars,

Thank you for reporting this bug.

I was able to recreate the issue on my machine and have registered a challenge for it.

This issue occurs when the PDF component is initially loaded with one file, and then the source of the PDF is changed an additional time. As a workaround, try to load the PDF component only when you know the content of the PDF is available. Manipulating the visibility of the PDF reader with an app variable and resetting it before reading the content.

We’ll keep you updated if we find a better solution for the problem.

Thanks for the workaround and the quick reply. It works now. I had a feeling this was a bug. I hope you’ll find a fix for it.

Just a follow-up. The app also crashes with the same message if I try to persist the PDF file (t) object while the PFD is still visible on the screen. Hiding the PDF viewer (or in my case closing the dialog) before persisting avoids the crash.