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

Object.values is not a function #124

Closed
amillward opened this issue Aug 16, 2019 · 5 comments
Closed

Object.values is not a function #124

amillward opened this issue Aug 16, 2019 · 5 comments

Comments

@amillward
Copy link

amillward commented Aug 16, 2019

Hi,

I use react-alert throughout my site, and Sentry is telling me I'm getting many of this error each day;
object values

I have not been able to reproduce the error, and I can't see from looking at the code why this would be happening. Anyone else having this issue or can spot what may be going on?

react-alert@5.5.0
react@16.8.6

Thanks

@schiehll
Copy link
Owner

Hi @amillward!

So you are probably getting this error when someone accesses your site via IE:
Screen Shot 2019-08-16 at 10 07 11

I think this was introduced when @besLisbeth added the constants for positions, types, transitions, etc...I could be wrong tho.

You can add a polyfill for it in your site, or maybe we could change it to something like:

Object.keys(positions).map(position => positions[position])

PRs are welcome.

@amillward
Copy link
Author

amillward commented Aug 16, 2019

react-alert

That was actually my first guess too, but Sentry is reporting a majority Safari/iPad users... :(

There's a chance Sentry is doing something weird with the error merging? Perhaps it's worth trying the polyfill/fix for IE first and seeing if the issue continues

@schiehll
Copy link
Owner

Yeah, probably old devices running old versions of browsers...but the solutions stands: You can fix it by adding a polyfill for Object.values to your site, and we can also change the code for something else.

@schiehll
Copy link
Owner

It's fixed now in v6, thanks for reporting!

@ConcealGeek
Copy link

It's fixed now in v6, thanks for reporting!

in v6:

{Object.values(positions).map(position => (

There's a object.values() here that's forgotten

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

No branches or pull requests

3 participants