Client Side JavaScript being parsed differently even when V8 is not enabled

43 views
Skip to first unread message

Alan Wells

unread,
Apr 14, 2020, 3:29:50 PM4/14/20
to Google Apps Script Community
I recently published a new version of an add-on, and my client side JavaScript stopped working because it is now being parsed differently when the html loads.  I was able to fix the problem by loading some global objects in a script tag in the head tag to make sure that they are available when subsequent  code loads.  Even though I have not changed the server script project to V8, the client side JavaScript seems to now be parsed, when loaded, in the new way.  Just an observation.

Andrew Roberts

unread,
Apr 15, 2020, 6:03:54 AM4/15/20
to google-apps-sc...@googlegroups.com
I've been seeing Google-side weirdness too. These are certainly uncertain times!

On Tue, 14 Apr 2020, 20:29 Alan Wells, <aj.a...@gmail.com> wrote:
I recently published a new version of an add-on, and my client side JavaScript stopped working because it is now being parsed differently when the html loads.  I was able to fix the problem by loading some global objects in a script tag in the head tag to make sure that they are available when subsequent  code loads.  Even though I have not changed the server script project to V8, the client side JavaScript seems to now be parsed, when loaded, in the new way.  Just an observation.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/7315713e-22b4-49f9-9179-6aee6aca273f%40googlegroups.com.

Dimu Designs

unread,
Apr 15, 2020, 9:33:45 AM4/15/20
to Google Apps Script Community
Maybe we're getting the new GAS editor sooner than we thought...

Thomas P.

unread,
Apr 18, 2020, 6:18:34 AM4/18/20
to Google Apps Script Community
I was able to fix the problem by loading some global objects in a script tag in the head tag to make sure that they are available when subsequent  code loads.
That sounds very much like the Rhino-V8 incompatibility described at "Migrating to V8 runtime"::"Avoid calling functions before they are parsed".

Even though I have not changed the server script project to V8 ...
According to Google, at "V8 Runtime overview"::"Automatic migration of scripts to V8", then: "Starting February 18, 2020 Google will start gradually migrating existing scripts that pass our automated compatibility test to V8."

So, did you actively choose "to opt a script out of automatic migration"?
- If not, then that's probably the explanation (i.e. your script was silently migrated, switched from running under the Rhino RTE to running under the V8 RTE).
Yes, Google said that "The affected scripts continue to function normally after [Google's forced automatic silent] migration."; But remember that Google's founders long ago said that "Google is not a conventional company. We do not intend to become one.", hence "function normally" is (undoubtedly) just a Google-euphemism for SNAFU.

Alan Wells

unread,
Apr 18, 2020, 9:34:37 AM4/18/20
to Google Apps Script Community
 I just checked my manifest file, and I had not changed the manifest file to explicitly use the DEPRECATED_ES5, so that's what must have happened.  Thanks for pointing that out.  Even though the "Run" menu in the code editor still has the menu item to:

Enable new Apps Script run time powered by Chrome V8

still present, it's actually already enabled by default.  So, the "Run" menu item Enable new Apps Script run time powered by Chrome V8 is misleading. 
Reply all
Reply to author
Forward
0 new messages