I've had this issue with the latest version Safari (16+) and I had no choice but to fork the project and fix it. The issue is that pdf.js is written using modern JS features that Safari does not support (yep, I know, Safari sucks... Safari is the new IE... Thanks Apple!). For example, it does not support `Promise.withResolvers` which required polyfills and so on.
In case this helps, here is my fork https://github.com/nicolasdao/pdf.js
I've included at the top of that README how to install it in your JS project.