Skip to content

Diagnostic reference

The script completed but did not return anything

Fix The script completed but did not return anything in Google Apps Script web apps by returning HtmlOutput or ContentService TextOutput from doGet and doPost.

Updated December 6, 2026

Apps Script error

The script completed but did not return anything.

What it means

An Apps Script web app entry point (doGet or doPost) must return an HtmlOutput (from HtmlService) or a TextOutput (from ContentService). Omitting return, returning a plain string or object, returning an unevaluated HtmlTemplate, or exiting early from an if branch causes the deployed /exec URL to show this error page.

Related error messages

  • Script function not found: doGet
  • Script function not found: doPost
  • The script completed but the returned value is not a supported return type.

Before and after

The code before and after the fix.

Problem 2 changed lines
function doGet(e) {
  const template = HtmlService.createTemplateFromFile('Index');
  template.user = e.parameter.name || 'Guest';
  // Bug: missing return, or returning the unevaluated HtmlTemplate.
  template.evaluate();
}
Fixed 1 changed line
function doGet(e) {
  const template = HtmlService.createTemplateFromFile('Index');
  template.user = e.parameter.name || 'Guest';
  return template.evaluate().setTitle('Status portal');
}

How to fix it

  • Return HtmlService.createHtmlOutput(...), HtmlService.createHtmlOutputFromFile(...), or template.evaluate() from every code path in doGet(e).
  • For JSON or plain-text webhook responses in doPost(e), return ContentService.createTextOutput(JSON.stringify(data)).setMimeType(ContentService.MimeType.JSON).
  • Remove async from doGet or doPost, because Apps Script web apps do not await returned Promises.
  • After editing the code, update the deployment under Deploy > Manage deployments with a new version so the /exec URL serves the fix.

Things to check

  • The test /dev URL serves HEAD code, while /exec serves the pinned deployment version until you create a new version.
  • myFunction catches missing doGet/doPost returns, unevaluated HtmlTemplate returns, and async web app entry points under rules MF93003, MF93006, and MF93014.

In the Apps Script editor

Catch errors like this before clicking Run.

myFunction (published as Error Checker for Google Apps Script on the Chrome Web Store) checks your code while you edit at script.google.com. Diagnostics, autocomplete, and rule-based quick fixes are free without an account, run in your browser, and request no Google Drive, Gmail, or Apps Script project OAuth scopes. Writing Apps Script with an AI coding agent? Connect the Apps Script MCP server to run the same static checks before pasting code.