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

Error: (Safari 12.1.2) window.matchMedia("(prefers-color-scheme: dark)").addEventListener is not a function. #494

Open
yunsteel opened this issue Oct 15, 2024 · 0 comments · May be fixed by #495

Comments

@yunsteel
Copy link

yunsteel commented Oct 15, 2024

Describe the feature / bug 📝:

On Safari mobile(iOS 12.5.7, Mobile Safari 12.1.2), using "addEventListner" makes error.
The full error message that occurs in sentry is as follows.
window.matchMedia("(prefers-color-scheme: dark)").addEventListener is not a function. (In 'window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:e})=>{L(e?"dark":"light")})', 'window.matchMedia("(prefers-color-scheme: dark)").addEventListener' is **undefined),**

Steps to reproduce the bug 🔁:

  1. On Safari mobile(iOS 12.5.7, Mobile Safari 12.1.2), use dark mode
@yunsteel yunsteel changed the title Error report: window.matchMedia("(prefers-color-scheme: dark)").addEventListener is not a function. Error report: (Safari 12.1.2) window.matchMedia("(prefers-color-scheme: dark)").addEventListener is not a function. Oct 15, 2024
@yunsteel yunsteel changed the title Error report: (Safari 12.1.2) window.matchMedia("(prefers-color-scheme: dark)").addEventListener is not a function. Error: (Safari 12.1.2) window.matchMedia("(prefers-color-scheme: dark)").addEventListener is not a function. Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant