Closed glenne closed 2 years ago
Hm, maybe you can share sample repo you are using? I was able to get this to work. First you need to add the right permissions in the appscript.json file. If you run as is you should get an error like Exception: You do not have permission to call Session.getActiveUser. Required permissions: https://www.googleapis.com/auth/userinfo.email
. Add "https://www.googleapis.com/auth/userinfo.email" to the list of scopes in appscript.json if you haven't already. I can provide a minimal example if you need it.
My problem was my vscode autocomplete when referencing the server function added a direct import from ../../server instead of going thru the serverFunctions shim. Your example was very helpful in ferreting out the source of my error. Perhaps an enhancement would be to somehow cause client code to not autocomplete to server code or end with a build failure.
I appreciate you taking the time to build an example - very helpful! Thanks.
I have code in my server implementation as
After I deploy and run it, I get 'Session' undefined. I also get 'PropertiesService undefined' if that code is hit.
I'm able to use HtmlService, SpreadsheetApp, and UrlFetch apis without issue.
Why are these undefined and how can force them to be defined?