Failed to generate PDF: r.findLastIndex is not a function
andybuki opened this issue · 11 comments
Safari -> same issue
Does this happen for every manifest you've tried or is this specific to just some manifests?
Just tried it with the latest Firefox version on https://pdiiif.jbaiter.de with the manifest from your example and it generated fine for me:
https://iiif.crossasia.org/s/dllm/madoc/api/manifests/20817/export/3.0
Thammasangkini pakalana wohan (ທັມມະສັງຄິນີປະກະຣະນະໂວຫານ).pdf
I just tried it on mac os safari/firefox -> everything works right.
I get this issue on Windows Firefox version 102.12.0 64 Bit.
Safari issue was one from users (I don't know the details)
May be it can help i add image with an issue:
I just noticed that it adds semicolon to the link:
Error fetching https://iiif-content.crossasia.org/xasia/dllm+dllm_00011171+457165/full/full/0/default.jpg:
It works only without ":"
I'm pretty much at a loss at what could cause this. Uint8Array.findLastIndex
has been part of Firefox since version 47, which was released in 2016. Can you try a few times and see if that changes things? Also, are you absolutely sure that this error occurs on Firefox 102?
Thank you! I'll try to set up a windows VM and see if I can reproduce it 👍
OK, I probably shouldn't analyze bugs immediately after a long day of work :-)
Turns out I had confused TypedArray#findLastIndex
(which takes a predicate) with TypedArray#lastIndexOf
(which takes a value). The former has only been part of Firefox since version 104 and Safari 15.4 (from last year), so it's obviously not in Firefox 102 or older Safari versions.
So sorry about that, I'll implement a polyfill for older versions, thank you for reporting the issue!
I agree with you, it is an old versions. in other computer everything works right. Thanks for support.
Nono,I was mistaken in my earlier comments (due to me confusing it with a different function), browsers without TypedArray#findLastIndex
are definitely not old, the API is just very new and I wasn't aware of that when writing the code. The next release will include the polyfill and it should work on more browsers :-)