title: GMail Google Apps Script Plugin "The value returned from Apps Script has a type that cannot be used by the add-ons platform"
body: <p>In the last 24 hours, a <strong><em>previously working</em></strong> GMail plugin I run has started failing.</p>
  
  <p>I stripped it all the way down to only trying to get the example from the <a href="https://developers.google.com/apps-script/reference/card-service/text-button#setcomposeactionaction,-composedemailtype" rel="nofollow noreferrer">docs</a> working:</p>
  
  <pre><code>var action = CardService.newAction().setFunctionName('composeEmailCallback');
  CardService.newTextButton()
      .setText('Compose Email')
      .setComposeAction(action, CardService.ComposedEmailType.REPLY_AS_DRAFT);
  
  // ...
  
  function composeEmailCallback() {
    var thread = GmailApp.getThreadById(e.threadId);
    var draft = thread.createDraftReply('This is a reply');
    return CardService.newComposeActionResponseBuilder()
        .setGmailDraft(draft)
        .build();
  }
  </code></pre>
  
  <p>On BUILD (not on button press), the previously working GMail Addon displays the error message:</p>
  
  <pre><code>The value returned from Apps Script has a type that cannot be used by the add-ons platform. Also make sure to call build on any builder before returning it. Value: values {
    proto_value {
      type_url: "type.googleapis.com/caribou.api.proto.addons.templates.publicapi.ContextualAddOnMarkup.Card"
      value: "...(omitted)"
    }
  }
  </code></pre>
  
  <p>Is this a new, known issue? Does anyone have some troubleshooting steps to share?</p>