0

I'm using Google Script to develop a web app where information is added and sent to a spreadsheet but I'm having problems simply getting the web app to publish a finable page.

Following a tutorial I found, I have the script

function doGet(){

    return HtmlService.createHtmlOutputFromFile("cash");

}

I then created a new html file with the same name (cash) and Tried to create just a header.

<!DOCTYPE html>
    <html>
      <head>
        <base target="_top">
      </head>
      <body>

        <h1>Runner Cash</h1>

      </body>
    </html>

From here, I've saved everything then gone through the publish - deploy as web app - create - then I go to click in dev by clicked "test web app for your latest code" but immediately get hit with an error enter image description here

Anyone have thoughts on why it's not publishing the page?

edit I've opened my project in an incognito mode and I was able to open in development, /dev, but I still can't open the actual url. When I do I get an error "Script function not found: doGet".

How come I can only access /dev in incognito and why is the function supposedly not working?

  • 1
    Welcome to [so]. Try using Google Chrome in incognito mode with all the extensions disabled. First open your project then open the /dev link. – Rubén Sep 09 '20 at 17:58
  • So this worked but now I have more questions. Will I only be able to work on this via incognito? I'm able to see the /dev link but I can't open the link itself. The error is "Script function not found: doGet ". Is this now a new issue? – Emily Prior Sep 09 '20 at 18:04
  • Please [edit] the question to include what you tried as well a brief description of your search/research efforts as is suggested in [ask]. – Rubén Sep 09 '20 at 18:11

1 Answers1

0

It's very likely that you have signed-in in multiple Google accounts and that you created your script using one of your secondary accounts. If this is correct, then you are facing a known "issue".

Workarounds

  1. As you already did, try using another web browser or your web browser in private mode. Be sure to sign-in only in the account used to create your script.
  2. Sign-out of all your accounts, then sign-in again first with the account used to create your script.

Regarding the error

Script function not found: doGet

double check that your script hasn't a typo and that you saved the file having the doGet function.

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • 2
    If it is the case that it has to do with multiple accounts: a tip: Create a chrome 'account' for each gmail. This will solve that problem https://support.google.com/chrome/a/answer/9025411?hl=en – RemcoE33 Sep 09 '20 at 19:44