anchorme.js icon indicating copy to clipboard operation
anchorme.js copied to clipboard

Imcompatibility with older iOS systems

Open Enngage opened this issue 1 year ago • 4 comments

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!

Enngage avatar Apr 08 '23 08:04 Enngage

The actual error message in iOS browser is:

invalid regular expression: invalid group specifier name

o-alexandrov avatar Apr 14 '23 09:04 o-alexandrov

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

danspam avatar Apr 25 '23 03:04 danspam

We just ran into this too and have had to revert back to the 2.x release of anchorme.

nfm avatar May 09 '23 10:05 nfm

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.

farce1 avatar Jan 16 '24 15:01 farce1

should be fixed in the latest version 3.0.7

alexcorvi avatar Apr 08 '24 08:04 alexcorvi