Converting script from Rhino to V8

10 views
Skip to first unread message

CSL Marketing

unread,
7:20 AM (11 hours ago) 7:20 AM
to Google Apps Script Community
We have online training that is built using Articulate Storyline and we then package and send to our website host to publish.  This was built like 10 years ago and the build is no longer supported. The Apps script that sends the results to a Google sheet is no longer working due to the change to V8.

I have only just got access to the script and have no idea what needs changing to convert it from Rhino to V8 compatibility. 

Emerson Maia

unread,
7:49 AM (10 hours ago) 7:49 AM
to google-apps-sc...@googlegroups.com
First thing to check: have you already switched this Apps Script project to the V8 runtime in the editor (Project Settings → Runtime → V8)? If not, please enable V8 first and let us know if the issue persists. If that doesn’t fix it, we’ll probably need to update parts of the code, because some Rhino-only syntax isn’t compatible with the V8 runtime.



configurarv8.png


Expert  Docs

Emerson Maia

Goiânia Go

Brazil




On Tue, Jun 23, 2026 at 8:20 AM CSL Marketing <kemsol...@gmail.com> wrote:
We have online training that is built using Articulate Storyline and we then package and send to our website host to publish.  This was built like 10 years ago and the build is no longer supported. The Apps script that sends the results to a Google sheet is no longer working due to the change to V8.

I have only just got access to the script and have no idea what needs changing to convert it from Rhino to V8 compatibility. 

--
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 visit https://groups.google.com/d/msgid/google-apps-script-community/c8b9a9bd-8473-4d92-afd9-2f6ae19f79aen%40googlegroups.com.

Alan Wells

unread,
7:49 AM (10 hours ago) 7:49 AM
to Google Apps Script Community
The documentation is at:

Step 1: Enable the V8 Runtime

Toggle the runtime directly in the Apps Script editor:

  1. Open your Apps Script project.

  2. Click on Project Settings (the gear icon on the left sidebar).

  3. Check the box that says Enable Chrome V8 runtime

Step 2: Rewrite Code if necessary

There are a few changes that might cause your script to throw errors

1. Extraneous Comma in Object Literals

Rhino ignored trailing commas in object definitions; V8 will throw a syntax error.

  • 🛑 Rhino (Broken in V8): var obj = { a: 1, b: 2, };

  • V8 (Fixed): const obj = { a: 1, b: 2 };

2. Modern Variable Scoping (var vs let/const)

In Rhino, var had function-level scope. V8 introduces block-scoping. If you start swapping var for let or const, make sure you aren't trying to call a variable outside of the {} block it was defined in.

3. Logger.log() Formatting

In Rhino, Logger.log() allowed SQL-style formatting string inputs (like %s). V8 prefers standard string concatenation or, better yet, modern template literals.

  • 🛑 Rhino: Logger.log("User %s logged in", username);

  • V8: Logger.log(\User ${username} logged in`);`

4. Direct Object/Array Modifications

V8 is much stricter about modifying built-in prototypes. If your script alters standard objects (like adding custom methods directly to Array.prototype), it might behave unexpectedly or throw errors.

Feature
Old Rhino Way
New V8 Way
Arrow Functions
function(x) { return x * 2; }
x => x * 2
Template Literals
"Hello " + name + "!"
`Hello ${name}!`
Destructuring
var first = array[0]; var second = array[1];
const [first, second] = array;
Classes
Prototypes and closures
Standard class MyClass { ... } syntax

Are you encountering a specific error message after turning on V8, or would you like me to review a specific piece of your script for compatibility?

Reply all
Reply to author
Forward
0 new messages