1

Something changed this afternoon that broke all of my Google App Scripts that are deployed as web apps. At the moment every call to:

google.script.run.[anything]

from the interface (HTML side) to backend fails. If you go to something like Chrome's console it says the following:

Uncaught TypeError: Cannot read property 'run' of undefined

Firefox's developer tools are a little more explicit:

TypeError: google.script is undefined

So somehow google.script is no longer defined. Is this a bug Google introduced? Do we now need to call a script to get these methods (in the way we need to call https://apis.google.com/js/api.js?onload=onApiLoad for other features)?

Thanks!

tazz_ben
  • 259
  • 3
  • 10
  • You mean "formerly" not "formally" right? – Pointy Apr 20 '17 at 21:42
  • I'm actually getting the same issue since a few hours, maybe it's a temporary issue. EDIT: it has been submitted as a bug: https://issuetracker.google.com/issues/37544412 – patrick Apr 20 '17 at 22:43
  • It's working from my sidebars and dialogs. I don't have any web apps. – Cooper Apr 20 '17 at 22:50
  • Mine works just fine. Perhaps it was just fixed? Or maybe it's an update pushed just to some users. My account is a G Suite account so we get slightly different updates I think. – Vytautas Apr 21 '17 at 04:24

1 Answers1

1

Please see workaround. You need to load the Google File Picker using the Google API Loader library.

Community
  • 1
  • 1
Amit Agarwal
  • 10,910
  • 1
  • 32
  • 43
  • Thank you for the workaround! I wish I understood why it worked, however. Is there a race condition when we call on the onload get parameter? I'm not understanding why the load method for the File Picker would impact the google.script methods. – tazz_ben Apr 21 '17 at 11:18
  • @tazz_ben Erik from the Google Apps Script team says " the cause of the problem is that when the Picker API loads into google.picker, it is currently overwriting google.script, so google.script.run() calls start failing." https://issuetracker.google.com/issues/37127474#comment36 – Amit Agarwal Apr 21 '17 at 17:22