16

This is a bug report for Stack Exchange frontend code (sstatic.net); don't close it as off-topic!

Script error: Missing polyfill for replaceAll

On older browsers, the site is broken. I can't click on any button. There is no String.prototype.replaceAll:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll#browser_compatibility

There is an error on this script here:

https://cdn.sstatic.net/Js/stub.en.js?v=17e20b4b4731

Uncaught TypeError: l.replaceAll is not a function at a (stub.en.js?v=17e20b4b4731:formatted:55) at full.en.js?v=3708f79bf934:formatted:2365 at Object.266 (full.en.js?v=3708f79bf934:formatted:2493) at __webpack_require__ (full.en.js?v=3708f79bf934:formatted:11524) at a (full.en.js?v=3708f79bf934:formatted:138) at e (full.en.js?v=3708f79bf934:formatted:11676) at full.en.js?v=3708f79bf934:formatted:11684 at full.en.js?v=3708f79bf934:formatted:11726 at full.en.js?v=3708f79bf934:formatted:11728 

[email protected] needs to be updated. See String.prototype.replaceAll not polyfilled #13701:

https://github.com/babel/babel/issues/13701#issuecomment-925119447

10
  • 1
    Probably related to this: JavaScript no longer works all of a sudden | We're Migrating our JavaScript Commented Dec 14, 2021 at 0:59
  • @hkotsubo Yea, it's probably because of that site JS update. Commented Dec 14, 2021 at 1:05
  • 2
    I can confirm that adding a replaceAll polyfill fixes the website. It's a simple fix. No other script errors. Works in old browsers again. Commented Dec 14, 2021 at 1:38
  • @XP1, what took you so long? "add comment" & "show more comment" no longer working on android tablet with firefox ;-) Commented Dec 14, 2021 at 9:58
  • @XP1, how does one add such a PolyFill? From the console? Commented Dec 14, 2021 at 12:47
  • Test snippet: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… Commented Dec 14, 2021 at 14:02
  • 3
    Just deployed a fix, should be sorted now. Let me know if you continue to have problems. Commented Dec 14, 2021 at 17:22
  • @Gerard H. Pille, I noticed something was wrong (couldn't vote) a few days ago, but I was too lazy to investigate. I assumed a major website would have this fixed before I would. :S Adding the polyfill in the console wouldn't work unless it was done before the script loads. It would have to be a user script or extension that loads before the script. However, what I did differently was intercept the HTTPS traffic and inject my own modified JS file instead of using the server's JS file. I used Fiddler web debugging proxy, so all browsers will receive my modified JS. No need console or extension. Commented Dec 14, 2021 at 20:31
  • @Benjamin Hodgson, thanks, currently typing in my old browser. :) Commented Dec 14, 2021 at 20:32
  • @XP1 if you use Chrome, it can be as simple as adding a local override in the meantime too Commented Dec 14, 2021 at 21:29

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.