hono icon indicating copy to clipboard operation
hono copied to clipboard

Unable to use honox-island before iOS 16.4 due to Safari is not supoorted lookbehind regex.

Open mrtska opened this issue 1 year ago • 2 comments

What version of Hono are you using?

4.0.5 (latest honox uses this version)

What runtime/platform is your app running on?

iOS 16.3 or lower

What steps can reproduce the bug?

Prepare a iOS 16.3 or lower iOS device.

Access the website which created with honox island component (e.g. honox-samples).

Errors occurred in browser console:

Unhandled Promise Rejection: SyntaxError: Invalid regular expression: invalid group specifier name

I haven't tested it without honox. Sorry.

What is the expected behavior?

No error occurred.

What do you see instead?

hono/jsx uses lookbehind regex in JavaScipt.

https://github.com/honojs/hono/blob/13c3156c67414fdb43ce30d6ce74f3ab1c349305/src/jsx/dom/render.ts#L93

It is not supported by iOS 16.3 or lower.

https://caniuse.com/js-regexp-lookbehind

To resolve this issue, we need to rewrite regex without lookbehind pattern as I think.

Additional information

I don't know about hono's compatibility policy for older devices or OS, if hono decides that this issue will not be resolved, I will follow your decision.👍

Everything else seemed to be working fine on iOS 15.4 I tested.

I think hono will be more compatible with older devices.

mrtska avatar Apr 17 '24 10:04 mrtska

Hi @mrtska

Thank you for raising the issue. I didn't know there is a specification for iOS like that!

@usualoma Can you handle this?

yusukebe avatar Apr 17 '24 22:04 yusukebe

Hi @mrtska

Thanks for the report! I wasn't aware of this behaviour in iOS either. I will fix it in #2524.

usualoma avatar Apr 18 '24 01:04 usualoma