Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mrtska opened this issue Apr 17, 2024 · 2 comments · Fixed by #2524
Closed
Labels

Comments

@mrtska
Copy link

mrtska commented Apr 17, 2024

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.

const match = key.match(/^on([A-Z][a-zA-Z]+?)((?<!Pointer)Capture)?$/)

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 mrtska added the bug label Apr 17, 2024
@yusukebe
Copy link
Member

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?

@usualoma
Copy link
Member

Hi @mrtska

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants