Skip to content

Before you click Run

Check Google Apps Script for errors before running it

When you paste code from ChatGPT, Claude, or Gemini, or edit a script by hand at script.google.com, the native editor checks syntax when you save. myFunction, published on the Chrome Web Store as Error Checker for Google Apps Script, underlines broken methods, missing arguments, slow loops, and cross-file mistakes while you edit, before the script touches your spreadsheet.

What breaks at runtime

Five errors the native editor misses until you click Run.

The Apps Script editor checks basic JavaScript syntax when you save, such as a missing parenthesis or an unclosed quote. It does not check whether a method exists on a Google Sheets class, whether required arguments are missing, or whether a loop repeats slow spreadsheet calls.

TypeError · invented methods

Invented or misspelled method names

ChatGPT, Claude, and Gemini often write plausible method names that Apps Script does not declare, such as sheet.hideGridlines() instead of sheet.setHiddenGridlines(true), or call a Sheet method on a Spreadsheet object.

Read TypeError: X is not a function

Missing parameters

Missing or mismatched arguments

Calling GmailApp.createDraft() without its required recipient, subject, and body, or passing a string where a number is required, saves without warning in the native editor and fails only when that line executes.

Read missing required arguments

Performance · MF90001

getValue() repeated inside a loop

Reading or writing one cell per loop iteration makes a remote Apps Script service call on each step. The script can work on a five-row test and then hit the 6-minute execution limit on a real spreadsheet.

Read service call inside a loop

Literal values · MF91003

Malformed email recipients

Apps Script types MailApp and GmailApp recipient fields as plain strings. A typo or missing domain inside a comma-separated cc list stays invisible until the script tries to send mail.

Read invalid email recipient

Cross-file scope · TS2552

Renamed functions across .gs files

Files in an Apps Script project share one global scope. Renaming a helper function in one .gs file leaves callers in other files pointing at a missing name, and the native editor does not warn you on save.

Read ReferenceError: X is not defined

Before and after

Catch common AI-generated bugs before they hit your sheet.

Both examples below save without syntax errors in script.google.com. myFunction underlines the problem in the editor while you review the code.

Example 01 · Unknown method

Invented method name: sheet.hideGridlines()

AI assistants frequently guess sheet.hideGridlines(). SpreadsheetApp.Sheet declares setHiddenGridlines(boolean) instead, so the pasted code stops with TypeError: sheet.hideGridlines is not a function. myFunction validates each call against declarations generated from the Apps Script runtime.

Fails at runtime · TypeError 1 changed line
function hideSheetGridlines() {
  const sheet = SpreadsheetApp.getActiveSheet();
  sheet.hideGridlines();
}
Declared Sheet method 1 changed line
function hideSheetGridlines() {
  const sheet = SpreadsheetApp.getActiveSheet();
  sheet.setHiddenGridlines(true);
}

Example 02 · Loop batching (MF90001)

Repeated getValue() calls inside a loop

Calling sheet.getRange(row, 3).getValue() on each row makes one remote service call per cell, which can exceed the 6-minute execution limit on larger sheets. myFunction marks the repeated call (MF90001) and offers a rule-based batching quick fix for supported read loops so you can read the range once with getValues(). Review the preview before applying it to confirm the loop does not modify the cells being read.

Repeated remote call · MF90001 6 changed lines
function readStatuses() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const statuses = [];

  for (let row = 2; row <= sheet.getLastRow(); row++) {
    statuses.push(sheet.getRange(row, 3).getValue());
  }

  return statuses;
}
Batched getValues() read 6 changed lines
function readStatuses() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const lastRow = sheet.getLastRow();
  if (lastRow < 2) return [];

  return sheet
    .getRange(2, 3, lastRow - 1, 1)
    .getValues()
    .flat();
}

In Chrome at script.google.com

Check code as you edit, with no VS Code or clasp setup.

myFunction, listed on the Chrome Web Store as Error Checker for Google Apps Script, adds a TypeScript-based checker directly inside the Apps Script web editor. Open a project, paste or edit your script, and review underlined problems before you click Run.

Free without an account
Diagnostics, typed autocomplete, hover documentation, signature help, cross-file navigation, and rule-based quick fixes are free without signing in.
Runs locally in your browser
Checks run inside the Chrome extension on the files open in your editor tab, using declarations generated from the live Apps Script runtime and Google API Discovery documents for the 31 advanced services.
Never runs or saves your script
myFunction does not run functions, save project files, or create versions or deployments. A quick fix edits text in your open tab only after you preview it and choose to apply it. The optional Format on Save setting is off by default.
No Drive, Gmail, or Apps Script OAuth scopes
myFunction never requests Google OAuth scopes for your Apps Script projects, Google Drive, Gmail, or Calendar. Sign in with Google (identity scopes openid email profile) only if you want 5 AI quick fixes, JSDoc generations, or explanations a month, or myFunction Pro at $5.99/month to remove that monthly limit. See every permission and scope.
Using Claude, Cursor, or Copilot directly?
If an AI coding client writes your .gs files outside Chrome, connect it to the myFunction remote MCP server so the assistant calls gas_diagnostics and fixes errors before showing you the code (50 free tool calls a month with a Google account).

Questions

Frequently asked questions.

How do I check my Google Apps Script for errors before running it?
Install the myFunction Chrome extension (published on the Chrome Web Store as Error Checker for Google Apps Script) and open your project at script.google.com. It checks your open .gs files as you type or paste code, underlining unknown methods, missing arguments, slow loops, malformed email recipients, and broken cross-file calls before you click Run.
How do I check if ChatGPT, Claude, or Gemini Apps Script code has errors before running it on my spreadsheet?
Paste the generated code into your project at script.google.com with Error Checker for Google Apps Script (myFunction) installed, and do not click Run yet. The extension checks the code locally in Chrome against declarations generated from the Apps Script runtime, flagging invented methods, missing arguments, and slow loops without running or saving your script.
Why does AI-generated Apps Script throw "is not a function"?
AI models often invent plausible method names that do not exist on Google Apps Script objects, such as sheet.hideGridlines() instead of sheet.setHiddenGridlines(true), or call a real method on the wrong class. The native editor checks syntax when you save, so those calls fail only after you click Run. myFunction checks each call against the declared Apps Script methods while you edit.
Is there a code checker for Google Apps Script without VS Code or clasp?
Yes. myFunction (Error Checker for Google Apps Script) adds type checking, diagnostics, autocomplete, and rule-based quick fixes directly inside the browser editor at script.google.com. You do not need to install Node.js, VS Code, or clasp.
Does myFunction run my script, save my code, or request access to Google Drive or Gmail?
No. Diagnostics, autocomplete, and rule-based quick fixes are free without an account and run locally in Chrome on the files open in your editor tab. myFunction never runs your script, never saves or deploys your project, and never requests Google OAuth scopes for Apps Script projects, Google Drive, Gmail, or Calendar.

Chrome Web Store

Check your Apps Script in Chrome before clicking Run.

Install myFunction (Error Checker for Google Apps Script) from the Chrome Web Store. Diagnostics and rule-based quick fixes are free without an account.