I could make another special check for the case when the first setOnLoadCallback call occurs before the first load call. I think this is a bad practice, however, which becomes more clear when you consider what happens when there is more than one load call. Any calls of setOnLoadCallback that occur after the first load call will call the callback immediately after the first load is done, even if the intention is to wait for yet another load call to be done.
So I am curious if there is a legitimate need to call setOnLoadCallback before the first load. If there is, I might be motivated to add this special check. On Wed, Jun 7, 2017 at 11:53 AM, Daniel LaLiberte <[email protected]> wrote: > Yes, this was the planned update of the loader announced last week. Not > enough people tested it, apparently. > > This particular error is, I believe, a legitimate error message caused by > calling google.charts.setOnLoadCallback before calling > google.charts.load. It is documented that the order should be the other > way around. I hope it will be easy enough for people to fix. > > On Wed, Jun 7, 2017 at 6:43 AM, Julian Hullis <[email protected]> > wrote: > >> Hi, >> >> I've started getting the following error across all applications using >> the charts api. >> >> 'Uncaught Error: Must call google.charts.load before >> google.charts.setOnLoadCallback at Object.google.G.K.T.jl [as >> setOnLoadCallback] (loader.js:224)'. >> >> This includes a published app (hosted internally) that hasn't been >> updated for two weeks. >> >> Has there been an update to the api in the last 12 hours that could be >> causing this? >> >> Thank you. >> >> >> >> google.charts.setOnLoadCallback(function () { >> angular.bootstrap(document.body, ['opsRiskApp']); >> }); >> >> google.charts.load('43', { packages: ['corechart'] }); >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Visualization API" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to google-visualization-api@googl >> egroups.com. >> Visit this group at https://groups.google.com/grou >> p/google-visualization-api. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/google-visualization-api/7d910b9b-9d1b-4d71-a729-19cf45 >> 4971aa%40googlegroups.com >> <https://groups.google.com/d/msgid/google-visualization-api/7d910b9b-9d1b-4d71-a729-19cf454971aa%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > [email protected] <[email protected]> 5CC, Cambridge MA > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJPLA%3Df%3DkFRL%2Bs_veqbYKtZJwt7%2B34YKvNaQK4%2BMVCj8GA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
