App Script: script failed to launch without any time spent nor log

Hi everyone,

I have developed a set of scripts for google spreadsheet. And most of the scripts were developed inside an external library, with the code in GS and the prompt in HTML (I use CLASP with TS for info). The only scripts attached to this google spreadsheet is functions called from a custom menu in the spreadsheet that only delegate the call to the functions defined in my external library.

The idea behind that is to have this set of scripts available for several google spreadsheets used by several teams (and to maintain only at the same place the set of scripts instead of maintaining it for all the google spreadsheets separately).

Anyway, one of the member of one team is having issue (only this person, and this happen quite often for him). He runs one of the script from the custom menu, and the script fail, without any log nor any time spent. What is strange is that: from the log screen there is no arrow down to open the log. Here is a screenshot of the problematic call:

image

And here is another screenshot, of a call that fails but this time with logs and all:

image

And last thing, the callLibraryFunction is a particular function that I have implemented some times ago to answer a problem. The prompts and the scripts are both inside the library, but the prompt is called outside and then call a script from the library, which is inside the library. So I have used this function which takes as parameter the name of the function to call (with the name of the library, the namespace of the script - I use namespace and not a bundler - and the name of the function) and the parameters inside an array of the function to call:

/**
 * @param {string} func
 * @param {string[]} args
 */
const callLibraryFunction = (func, args) => {
  const funcs = func.split(".");
  const { libraryName, interfaceName, functionName } = { libraryName: funcs[0], interfaceName: funcs[1], functionName: func.split(".")[2] };
  return this[libraryName][interfaceName][functionName].apply(this, args || []);
}

I have used the solution of this thread for this issue: https://stackoverflow.com/questions/48928932/call-library-function-from-html-with-google-script-run. I do not know if this is the reason why one of the user fail sometimes to use my scripts but as this is quite a particular use case, I had to mention it.

If you need any additional information, do not hesite, this is the first time I post a question so I probably forgot to provide a central piece of information, sorry in advance for that :confused: !

Hey,

Hope you’re keeping well.

This kind of “silent” failure in Apps Script, where no execution time is recorded and no logs appear, usually means the script never actually started running on Google’s servers. In cases involving custom menus and google.script.run calls from HTML, this is often due to client-side issues such as the browser losing the connection to Apps Script or an authorization token expiring before the request is sent.

For the affected user, first check Apps Script authorization by having them open the script editor from the spreadsheet and manually run any function to trigger the OAuth consent flow again. Also confirm they are using a supported browser with third-party cookies enabled, since google.script.run relies on those for session handling. If the library call is wrapped in your callLibraryFunction, ensure that all namespaces are loaded before the function is invoked, otherwise the call will fail locally and never reach the server. You can add console.log statements in the HTML before google.script.run to verify the request is actually being made from the client side.

Thanks and regards,
Taz