Diagnostic reference
The parameters (...) don't match the method signature
Why Google Apps Script throws The parameters (...) don't match the method signature for getRange, setValues, formatDate, and createEvent, and how to fix types.
Updated December 6, 2026
Apps Script error
Exception: The parameters (String,number,number,number) don't match the method signature for SpreadsheetApp.Sheet.getRange.
What it means
Apps Script built-in services are backed by typed Java bindings, so passing a string where a number is expected, a 1D array to setValues(), a string to Utilities.formatDate(), or undefined to CalendarApp.createEvent() fails with a method signature error. Unlike plain JavaScript, built-in methods do not silently coerce wrong types or accept extra arguments.
Related error messages
- Exception: The parameters (String) don't match the method signature for SpreadsheetApp.Range.setValues.
- Exception: The parameters (String,String,String) don't match the method signature for Utilities.formatDate.
- Exception: The parameters (String,String,String) don't match the method signature for CalendarApp.Calendar.createEvent.
- Exception: The parameters (number[]) don't match the method signature for DocumentApp.Body.appendTable.
- Exception: The parameters (String) don't match the method signature for DriveApp.File.moveTo.
Before and after
The code before and after the fix.
function readTotals() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Orders');
if (!sheet) throw new Error('Missing Orders tab.');
// Passing a string row index or a Date string instead of a Date object fails.
const range = sheet.getRange('2', 1, 10, 3);
const stamp = Utilities.formatDate('2026-12-06', 'Etc/UTC', 'yyyy-MM-dd');
Logger.log(stamp + ': ' + range.getValues().length);
}function readTotals() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Orders');
if (!sheet) throw new Error('Missing Orders tab.');
const range = sheet.getRange(2, 1, 10, 3);
const stamp = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), 'yyyy-MM-dd');
Logger.log(stamp + ': ' + range.getValues().length);
}How to fix it
- Read the type list in parentheses from left to right and match each position to the method reference.
- Convert numeric strings with Number(value) before passing row or column coordinates to getRange().
- Pass a real Date instance (new Date(value)) to Utilities.formatDate() and CalendarApp.createEvent(), not a formatted string.
- Wrap a 1D row array as [row] before passing it to Range.setValues(), which always expects a 2D array.
- Pass a Folder object from DriveApp.getFolderById(id) to File.moveTo(), not a folder ID string.
Things to check
- When a parameter prints as (null) or (undefined), trace the variable back to an empty cell, missing sheet, or undefined function argument.
- myFunction checks every built-in method call against generated Apps Script type declarations in the editor, flagging wrong parameter types and counts before you run the script.
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.