I have a randomly occurring issue (haven't yet really managed to figure out how to reproduce this, it happens erratically) with GAS libraries where development mode simply isn't working.
The static version of the library is always loaded regardless of the actual state of saved files in the library. The manifest files are in order, I have two scripts on two accounts (A and B) that use library C as a resource.
Script A manifest:
{
"timeZone": "Europe/Paris",
"dependencies": {
"libraries": [{
"userSymbol": "lib",
"libraryId": "<id>",
"version": "33",
"developmentMode": true
}]
},
"exceptionLogging": "STACKDRIVER"
}
Script B manifest:
{
"timeZone": "Europe/Paris",
"dependencies": {
"libraries": [{
"userSymbol": "lib",
"libraryId": "<id>",
"version": "33",
"developmentMode": false
}]
},
"exceptionLogging": "STACKDRIVER"
}
The library is at a static version 33 with dozens of changes and saves following the static version. I would expect script A to load the latest changes, but it's as static as script B.
I can't figure out what's going on.
I'm using clasp for sync if that matters. If I ditch clasp and use the built-in editor to do everything, after saving a new version manually, doing a few edits and then loading script A, it seems to magically start to work in development mode.
Using clasp after that (even to create newer static versions from the command line) will work for a period of time, and then randomly stop. One random clasp version
command at a random period of time later will freeze the library at the newly created static version, and subsequent clasp push
will be done, the files synced, but the development mode will cease to be enforced (even though it's on).
This would imply that clasp isn't syncing properly, but that's not true - opening the script in the browser editor shows that all the files are properly synced, saved, and showing changes well past the static version and the "development mode" switch follows the manifest files accordingly.
Upon further analysis, I suspect that it might have something to do with Google's caching servers? In this scenario: same Spreadsheet, two users on two different Google accounts accessing the Library in development mode, one is actually seeing development, the other is static. Clearing local browser cache and app data doesn't help, so it must be on the delivery end.
Google is having delays updating the development version across all users and all projects that use the library, maybe?
Summary
What makes the library START working in development mode again?
Opening the Library in the browser editor and saving a new version manually. Sometimes it has to be done multiple times to work.
What makes the library STOP working in development mode?
From what I can tell, clasp version
, but not always. Yesterday I saved 5-6 versions with "clasp version" from the command line and subsequent clasp push
commands did show up in development mode. It was the random Nth clasp version
that broke stuff.
Based on the attempted steps to solve this, there is no clear solution.
push
from claspRunning clasp deploy -V <version> -id <deployment-id>
If you are a subscriber to a G Suite account, please contact the G Suite support for assistance.