Open Congchuabongbong opened 2 months ago
Which browser are you using? According to https://caniuse.com/?search=promise.withResolvers, browser support should be pretty good - with the exception of Safari: only the latest version of Safari supports this method.
Currently I'm using Chrome!
Yes, you're right - I was blind yesterday, I should have seen it from your screenshot. Which version are you using?
i'm using latest version! exactly it's 124.0.6367.61
That's weird. Nonetheless, the withResolvers()
function is fairly new, so it makes sense to check whether the browser supports it. I'm preparing a browser switch.
Ok, I hope you will find the cause and I will also try to find the cause
The improvement is going to land with version 20.0.0-alpha.2.
Version 20.0.0-alpha.2 was buggy. It always used the ES5 version of the code. Version 20.0.0-alpha.3 uses a more clever approach.
Hey @stephanrauh,
unfortunately we still have trouble with this on safari. We tested this on Safari 15.6, 16.5 and 17.4.
17.4 works, but both older Browsers don't work.
It seems like zoneJS is messing things up here. When zoneJS is monkey patching the browser apis it's also monkey patching the 'withResolvers'-Function. So the function is not undefined any more, but still throws the error when invoked.
Is there any chance to fix this?
Thank you!
@SimonKunz That's nasty. We have to talk serious with zone.js! :)
Jokes aside, I'm sure there's a way to solve it, but I'd like to talk you into finding the solution yourself and send me a pull request or to describe what I need to modify. I believe it's a task you can manage, and it helps me to catch up with the work that piled up during my vacations.
Browser detection happens in a file called op-chaining-support.js
. That's a very simple class that runs some test. If they pass, the flag window.ngxExtendedPdfViewerCanRunModernJSCode
is set to true, and otherwise the file crashed, so the flag remains undefined. Maybe you manage to call the withResolvers()
function to enforce the crash, or you find a different class/method/function that has been introduced after Safari 17.4.
I am installing and testing version ^20.0.0-alpha.1 and see the error as shown in the picture:
![image_2024_04_17T08_29_39_510Z](https://github.com/stephanrauh/ngx-extended-pdf-viewer/assets/78024720/cf6443e6-ad99-40bb-832f-6a47c0f03958)