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

Fix error with user-agent brand not being an array #1968

Merged

Conversation

arishoham
Copy link

We have thousands of errors a day caused by navigator.userAgentData.brands not being an array. This PR aims to fix that.

@rollingversions
Copy link

rollingversions bot commented Nov 21, 2022

Change Log for @popperjs/core (2.11.6 → 2.11.7)

Bug Fixes

  • fix: check if navigator.userAgentData.brands is an array

    While the API indicates it will always be an array, it appears some environments set it to a truthy non-array value causing the check to fail.

Edit changelog

@atomiks
Copy link
Collaborator

atomiks commented Nov 21, 2022

Where does this error surface?

@huntharo
Copy link

Where does this error surface?

It throws an exception when calling .map on something that is not an array.

Could you clarify if you were looking for something more specific?

@atomiks
Copy link
Collaborator

atomiks commented Nov 22, 2022

I'm fine with merging this, I'm just trying to understand how this is happening and how many people it affects.

I understand that it's erroring, but that should be impossible (in theory). What environment causes navigator.userAgentData.brands to exist, but brands to not be an array AND some kind of truthy value, especially since it's a new API - are you capturing this in Sentry or something? What value is brands in the env where it's erroring? The API docs says it is an array (although technically experimental).

@atomiks
Copy link
Collaborator

atomiks commented Nov 22, 2022

Going to just merge, since this check isn't critical anyway, it only avoids a message in DevTools

We'll try to release this soon 🕐 , in the meantime you can always use patch-package to fix dependencies while you wait for a new release or PR to get in for strange cases like this

@atomiks atomiks merged commit 2893e9a into floating-ui:v2.x Nov 22, 2022
atomiks added a commit that referenced this pull request Nov 22, 2022
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 this pull request may close these issues.

None yet

3 participants