Occasionally (say, 1 in every 25) when improving another users' question by adding their existing code to a snippet using the editor I am unable to save the changes I have made; nothing happens when I click the button except an error appears in the console:
https://cdn.sstatic.net/Js/snippet-javascript.en.js?v=fe42278b2fe2
Uncaught TypeError: Cannot read property 'save' of undefined
at i (snippet-javascript.en.js?v=fe42278b2fe2:1)
at HTMLDivElement. (snippet-javascript.en.js?v=fe42278b2fe2:1)
at HTMLDivElement.dispatch (jquery.min.js:3)
at HTMLDivElement.r.handle (jquery.min.js:3)
at Object.trigger (jquery.min.js:3)
at HTMLDivElement. (jquery.min.js:3)
at Function.each (jquery.min.js:2)
at n.fn.init.each (jquery.min.js:2)
at n.fn.init.trigger (jquery.min.js:3)
at e (stub.en.js?v=98d2853eec34:1)
Similarly, when this happens I also cannot click the 'Cancel' button to close the snippet editor, although this does not show an error in the console.
The snippet editor itself still functions correctly in this state. I can edit the code and run it as normal.
My only course of action when this happens is to refresh the page and try to edit again.
I have not yet managed to reproduce the issue with certainty. I originally believed this happened when the question was edited by someone else, but I have had it happen when no other edits were made. I also surmised that it could be a timeout or permissions issue, but the edit that caused the above error took me no longer than 30 seconds.
For reference I am using Chrome 68 on Win10. This has happened on older versions of Chrome too. I haven't tried it in other browsers.
List of occurrences since opening this question:
- 2018-09-06: Twice while editing this question. Had to open a new tab and copy over the snippet edits both times.
- 2018-09-20: Editing this question. Again, had to copy between snippet instances in different tabs.
- 2018-09-21: Answering this question. First presentation I've had of this bug when answering a question.
- 2018-10-08: Editing this question
- 2018-10-08: Editing this question - first back-to-back occurrence
- 2018-10-17: Editing this question
- 2018-12-14: Editing this question
- 2018-12-21: Editing this question
Update 2018-12-21
On the last failure I noticed there was a delay in opening the editor so thought to open the network console to check traffic as @Stijn suggested, and sure enough there was an error:
Active resource loading counts reached a per-frame limit while the tab was in background. Network requests will be delayed until a previous loading finishes, or the tab is brought to the foreground. See https://www.chromestatus.com/feature/5527160148197376 for more details
The other two 'ERR_BLOCKED_BY_CLIENT' errors would appear to be unrelated and instead caused by my adBlocker.