Hello,
I encounter with following problem. Let's assume code. It grabbs data from M2:M, and filter empty rows.
function foo() { var sheet = SpreadsheetApp.getActiveSheet();
var row = 2;
var column = 13;
var data;
data = sheet.getRange(row, column, sheet.getLastRow() - 1).getValues().flat().filter(Boolean);
}
When I debug code, it looks pretty nice. Empty rows are filtered and instead hundreds of rows, only filled shows:

However, when I run that function, I am getting "TypeError: The flat function could not be found in the object" (translated, despite English on Google services, errors shows in my national language for unkown reason).
I noticed this issue when I wanted to receive data using POST it shown as response.
Why does it only happen during execution, not debugging? How can I fix it?
Thank you in advance.