anchorme.js
anchorme.js copied to clipboard
Imcompatibility with older iOS systems
Hey!
Thanks for this library! I just wanted to reach out that in our app (Angular) we found out that the version 3.0.4
is not working in iPhones 13 (or older) without applying the latest apple's update.
I don't really have much specifics, but basically what happened is that we upgraded anchorme
from v2
to 3.0.4
and suddenly our app stopped working for some iPhone users. It basically broke the app entire angular build which prevented us from logging the error in the first place so it was difficult to debug. From the reports of our users we found out that this affected only users using iPhone 13 or older. However, if these users applied the latest Apple update (16.4.1), it started working again.
Also, if we downgraded anchorme from 3.0.4
to 2.1.2
it started working for all users again. Note that the downgrade in package.json was the only change we did.
It was really difficult to debug as we had literally no idea what was going on, but finally we were able to track it down to this library. It's not ideal as we've had to basically wait for users to report their issue and us asking them what device and platform they were using in order to track this one down.
Hopefully you can look at this to shed some more light or to prevent this from happening, cheers!
The actual error message in iOS browser is:
invalid regular expression: invalid group specifier name
This is due to the lookbehind in the following regex:
https://github.com/alexcorvi/anchorme.js/blob/19924b5e06afe511dea2c8baf2e105744cf8283d/src/regex.ts#L19
Safari iOS does not support them until v16.4 (released March 2023), according to caniuse: https://caniuse.com/js-regexp-lookbehind
We just ran into this too and have had to revert back to the 2.x release of anchorme.
Also, if we downgraded anchorme from 3.0.4 to 2.1.2 it started working for all users again. Note that the downgrade in package.json was the only change we did.
This workaround seems to be still valid. Hopefully, a potential fix will be added someday.
should be fixed in the latest version 3.0.7