Need Help.. do your time based triggers work in V8?

123 views
Skip to first unread message

aalt...@gmail.com

unread,
Dec 10, 2020, 11:56:07 AM12/10/20
to Google Apps Script Community
I recently released a new feature in my calendar addon that offloads some long processing function to a time triggered function, which is created like this:

```
const trigger = ScriptApp.newTrigger('runBatchJob').timeBased().after(1000).create();
```

While developing, it was working all fine while we are on HEAD. After releasing to a production branch, I noticed a number of users creating the trigger but it never runs after that.

After testing it on production with a different email, I noticed that my triggers are disabled (screenshot below).

I found this bug ticket issue which says that this is a bug on the V8 runtime and this issue is not happening if I use the `DEPRECATED_ES5` runtime.

Are you running time-based triggers on your app? which runtime are you using? What other alternatives do I have to run some of my long-processing function async?

Thanks

triggerDisabled.png

Adam Morris

unread,
Dec 10, 2020, 7:50:51 PM12/10/20
to google-apps-sc...@googlegroups.com
I can’t think of any reason why the new runtime would introduce the problem. I’ve started the issue. Let’s try and get more attention to this. 

--
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/dfc15175-a2ec-4294-b3c4-a02f5e4f5d98n%40googlegroups.com.
--

Marko Kolombo

unread,
Dec 11, 2020, 3:07:21 AM12/11/20
to google-apps-sc...@googlegroups.com
I stumbled in the same issue a couple of days ago, such a big bug.

But thanks a lot for the solution, I think I'll search (or build myself) a compiler ES6 to ES5 for GAS as a temporary solution until this is solved. I will share it when ready

Just hoping they don't deprecate Rhino before fixing this, otherwise it's going to be a mess.

Adam Morris

unread,
Dec 11, 2020, 3:15:38 AM12/11/20
to google-apps-sc...@googlegroups.com
Maybe there's something that can be done with babel?

Marko Kolombo

unread,
Dec 11, 2020, 3:21:58 AM12/11/20
to google-apps-sc...@googlegroups.com

Marko Kolombo

unread,
Dec 11, 2020, 5:42:07 AM12/11/20
to Google Apps Script Community
An update, I have created yesterday an issue (not knowing of the one that was mentioned here) and I got a reply already today. Hopefully it may raise some attention from GAS developers. Maybe you can star also this one to be updated https://issuetracker.google.com/issues/175139769#comment2

Marko Kolombo

unread,
Dec 11, 2020, 1:28:40 PM12/11/20
to Google Apps Script Community
Ok the webapp is ready (babel based), it compiles all .gs files from one script in ES6 to another in ES5, and it also reverts the runtime to Rhino.

I can happily announce that for me this SOLVED the issue :) 

Abba T

unread,
Dec 15, 2020, 1:42:54 PM12/15/20
to Google Apps Script Community
Thanks for the input Marc.

Yes, I can confirm that after changing to the depreacted ES5 runtime, the time based trigger worked for me. 

Btw, as we are using clasp, so we are using webpack. I was originally using a webpack configuration similar to this great starter repo for clasp.

However, that is actually setup to support v8, so I had to do some changes to the babel loader to compile back the code to ES5, including polyfill and using the `babel-preset-gas` too.

Reply all
Reply to author
Forward
0 new messages