guilhermerodz / input-otp

One time passcode Input. Accessible & unstyled.
https://input-otp.rodz.dev
MIT License
2.35k stars 47 forks source link

[BUG] : Failed to execute 'insertRule' on 'CSSStyleSheet' (Rare, some mobile devices) #37

Closed Jervx closed 5 months ago

Jervx commented 5 months ago

On some rare cases this error shows on some devices. This was sent to me by my client, She tried it on her husbands phone and the otp works, just on some devices it shows this error. I tried on other mobile devices I have here and couldn't recreate the error.

image

Uppon checking the source code is text : transparent instead of color : transparent. But I am not sure if this really the cause of the error.

Screenshot from 2024-03-18 18-54-32

Is there a possible fix/workaround for this?

Thanks for response 😄

guilhermerodz commented 5 months ago

hi @Jervx you're on point regarding the text (should be color instead).

just shipped a fix, please run npm i input-otp@latest, should be good as of 1.2.1

I'm surprised that she was able to read that error as an user, because insertRule is currently happening within a trycatch with console.error as a fallback:

CleanShot 2024-03-18 at 10 42 22@2x

solved by 968a23bab2cf3454b49bb50a597d82d788e76b0c


just got curious myself @Jervx can you tell me if she was able to use the OTP input besides the error? did the app actually break or is it only an application console log? thanks

Jervx commented 5 months ago

Goodmorning,

Appologize I forgot to include the version, I have input-otp 1.0.1

image About the error, Yes it is breaking the app and only showing a client side exception so I added the error.tsx to show the error.

I will update to the latest version and test it again, thank you 😄

guilhermerodz commented 4 months ago

hey @Jervx was there any issue while running the latest version?