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:
![]()
And here is another screenshot, of a call that fails but this time with logs and all:
![]()
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
!