mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.18k stars 503 forks source link

Bug: Media Source Extensions API crashes due to yari JavaScript - No browser compatability #5551

Closed danielhjacobs closed 2 years ago

danielhjacobs commented 2 years ago

Summary

https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API infinitely logs in the console t.releases is undefined, and if you open the JavaScript console the page quickly crashes. No browser compatibility appears on that page, and a statement says: "MediaSource interface Unfortunately, this table has encountered unhandled error and the content cannot be shown."

Where did you spot the bug?

https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API

Environment

Device

Browser

Operating system

caugner commented 2 years ago

Hi @danielhjacobs, I cannot reproduce the issue with Firefox 97 on Mac OS. Would you have a chance to test other browsers or even operating systems?

danielhjacobs commented 2 years ago

The crashing only happens on Firefox with the console open due to the infinite logging. On Chromium, the browser compatibility table is still missing with the error mentioned above, and the console says repeatedly:

TypeError: Cannot read properties of undefined (reading '31')
    at O (utils.ts:57)
    at M (legend.tsx:58)
    at U (legend.tsx:112)
    at ui (react-dom.production.min.js:157)
    at Wa (react-dom.production.min.js:267)
    at Ol (react-dom.production.min.js:250)
    at xl (react-dom.production.min.js:250)
    at kl (react-dom.production.min.js:250)
    at vl (react-dom.production.min.js:243)
    at react-dom.production.min.js:123
aa @ react-dom.production.min.js:216
danielhjacobs commented 2 years ago

Same error occurs on Chrome on Android, but of course I can't open the DevTools on Android to check the console.

danielhjacobs commented 2 years ago

So the error comes from https://github.com/mdn/yari/blob/b70f28c747be0cffc71f260a90480114a1221d15/client/src/document/ingredients/browser-compatibility-table/utils.ts#L57

I guess browser.releases is undefined, so browser.releases[version] fails

danielhjacobs commented 2 years ago

Weird: This does only affect the official MDN documentation.

This is the official documentation: Screenshot from 2022-03-09 10-44-14

This is localhost: Screenshot from 2022-03-09 10-44-17

caugner commented 2 years ago

Thanks for all the additional details!

I believe this is a duplicate of #5531 and has already been fixed in #5529, which has meanwhile been deployed.

And indeed, if I check https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API#browser_compatibility, everything looks fine.