Google stuff breaking: setOnLoadCallback

Table of Contents

img

I just had yet another case of stuff I am responsible to maintain breaking because of Google. My long-standing program has run with the following code:

google.setOnLoadCallback(function() { /* ... */ });

This has worked for a decade, but finally it seems to have broken. Fortunately, I already had a suspicion that it was a google thing breaking on me as this has happened before. While I am not part of whatever update list is warning about these upcoming changes, they were at least decent enough to tell me that I need to load() charts first. This time, it was an easy fix:

google.charts.load();
google.setOnLoadCallback(function() { /* ... */ });

And this is why, for all their good intentions of saving folks online space, for a robust web app I most certainly want to have my resources local and not changing underneath me. I’ve been spoiled too long by Clojure, with its almost obsessive attention to backward compatibility.

Tory Anderson avatar
Tory Anderson
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist