Skip to content

Conversation

@mydea
Copy link
Member

@mydea mydea commented Feb 3, 2023

Noticed this while debugging tests in sentry-javascript. it seems jsdom has a weird support for CSSMediaRule, where it is defined but if you look at CSSMediaRule.prototype it is:

CSSRule {
        parentRule: null,
        parentStyleSheet: null,
        constructor: [Function: CSSMediaRule],
        type: 4
      }

I guess maybe similar issues have triggered some of the errors we've seen in the past.

Note: We've been handling these errors already, but still good to fix it properly. I'll also PR this upsteam.

@mydea mydea requested review from Lms24 and billyvg February 3, 2023 11:09
@mydea mydea self-assigned this Feb 3, 2023
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@mydea
Copy link
Member Author

mydea commented Feb 3, 2023

For reference, this is probably fixed here: NV/CSSOM#111 but illustrates how we can't really rely on "this is supported everywhere!" thinking, sadly.

@mydea mydea merged commit 69f74e7 into sentry-v1 Feb 3, 2023
@mydea mydea deleted the fn/check-css-support-reliably branch February 3, 2023 11:20
billyvg pushed a commit that referenced this pull request Feb 3, 2023
Noticed this while debugging tests in sentry-javascript. it seems jsdom
has a weird support for `CSSMediaRule`, where it is defined but if you
look at `CSSMediaRule.prototype` it is:

```
CSSRule {
        parentRule: null,
        parentStyleSheet: null,
        constructor: [Function: CSSMediaRule],
        type: 4
      }
```


I guess maybe similar issues have triggered some of the errors we've
seen in the past.
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.

3 participants