Skip to content

Instantly share code, notes, and snippets.

@Oaphi
Last active November 22, 2022 18:48
Show Gist options
  • Save Oaphi/0ec39f820540aea069e02687446285f1 to your computer and use it in GitHub Desktop.
Save Oaphi/0ec39f820540aea069e02687446285f1 to your computer and use it in GitHub Desktop.
Web App troubleshooting questionnaire

Preliminary

  1. Does the Web App have a saved deployment? ("Publish" -> "Deploy as Web App")
  2. Are you accessing the /dev endpoint (https://script.google.com/.../yourIdHere/dev)?
  3. If you are accessing the /exec endpoint (https://script.google.com/.../yourIdHere/exec), did you redeploy?
  4. If you redeployed, did you increment the script version?
  5. If you have a client-side problem, what does the console say (pres F12 to open developer tools)?
  6. If you have a server-side problem, what do executions say (https://script.google.com/home/projects/yourIdHere/executions

Web App Access

  1. If you use google.script.run to call server-side code: did you add withSuccessHandler and withFailureHandler?
  2. If requests are "unauthorized", but you want a public API: did you deploy as "anyone, even anonymous" and "execute as me"?
  3. If requests are "unauthorized" and you want a users to login: did you include Authorization header in the request?
  4. If requests are authorized, but fail: did you create a doGet trigger function for GET requests or doPost for POST?

Return values

  1. If requests succeed, but return nothing: does your trigger function return either HtmlOutput or TextOutput?
  2. If google.script.run success handler returns nothing: did you return from the server-side function?

Debugging

  1. "Cannot read property 'parameter' from undefined": do you try to run doGet or doPost from Apps Script Editor? Event objects are only constructed at runtime when a request hits the Web App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment