Hello to everyone guys!
I've got a problem with the code below; my purpose is to retrieve all the .csv file in a google drive folder and put them all in sequence in a specific sheet in Google.
The error code that it get is: "Exception: Cannot convert 'function () { [native code] }1' to int."
Could you please help me solving that issue?
Many thanks in advance
function happendCSV() {
  const folder = DriveApp.getFolderById("ID_Folder");
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet_Name");
  const files = folder.getFiles();
  while (files.hasNext()) {
    let file = files.next();
    //let fn = file.getName();
    let fileID = file.getId();
    let fileType = file.getMimeType();
    if (fileType === "text/csv") {
      let csvData = Utilities.parseCsv(file.getBlob().getDataAsString(), ",");
      sheet.getRange(sheet.getLastRow +1, 1, csvData.length, csvData[0].length).setValues(csvData);
    }
  }
}


Happend multiple .csv file from Drive Folder to Unique Sheet in Google
Modification points:

In your script, sheet.getLastRow  of sheet.getRange(sheet.getLastRow +1, 1, csvData.length, csvData[0].length).setValues(csvData); should be sheet.getLastRow(). I thought that this might be the reason for your current issue of Exception: Cannot convert 'function () { [native code] }1' to int..
In your situation, I thought that getFilesByType might be useful.
When setValues is used outside of the loop, the process cost becomes low a little.

When these points are reflected in your script, it becomes as follows.
Modified script:
function happendCSV() {
  const folder = DriveApp.getFolderById("ID_Folder");
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet_Name");
  const files = folder.getFilesByType(MimeType.CSV);
  let values = [];
  while (files.hasNext()) {
    let file = files.next();
    let csvData = Utilities.parseCsv(file.getBlob().getDataAsString(), ",");
    values = [...values, ...csvData];
    console.log(`Now: ${file.getName()}`); // For confirming the current processing file.
  }
  sheet.getRange(sheet.getLastRow() + 1, 1, values.length, values[0].length).setValues(values);
}

Note:

If your CSV data is large, Sheets API might be suitable instead of Spreadsheet service (SpreadsheetApp).

References:

getFilesByType(mimeType)
getLastRow()

