You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug in convert_mimetype_of_file_on_google_drive: ReferenceError: blob is not defined #11
There appears to be a bug in the convert_mimetype_of_file_on_google_drive tool function.
Error:
When calling the tool with a valid file ID for a Google Slides presentation and dstMimeType: 'application/pdf', it fails with the following error: ReferenceError: blob is not defined at management_drive.js:267:128
Code Analysis:
The issue seems to be in the management_drive.js file within the convert_mimetype_of_file_on_google_drive function.
Suggested Fix:
A more robust implementation, which should prevent this error, is to explicitly get the file's blob before converting its type. The line should be changed as follows:
From:
constblob=file.getAs(dstMimeType);
To:
constblob=file.getBlob().getAs(dstMimeType);
This change ensures a valid blob is retrieved before the conversion is attempted and should resolve the issue.
Also, from your showing error message ReferenceError: blob is not defined at management_drive.js:267:128, I confirmed the reason for the error. It's as follows.
From
return `The mimeType of "${fileIds[i]}" was converted to "${dstMimeType}". The new file ID is "${DriveApp.createFile(blob).getId()}".`;
To
return `The mimeType of "${fileIds[i]}" was converted to "${dstMimeType}". The new file ID is "${DriveApp.createFile(e).getId()}".`;
I will modify it at the next official update soon. So, as the current update, I have modified it as the developer mode of the library.
Thank you for reporting it.
Activity
zorrofox commentedon Sep 9, 2025
A pull request has been submitted to address this issue: #12
tanaikech commentedon Sep 9, 2025
Thank you for your comment.
Unfortunately, I cannot find the following part from management_drive.js.
Also, from your showing error message
ReferenceError: blob is not defined at management_drive.js:267:128, I confirmed the reason for the error. It's as follows.From
To
I will modify it at the next official update soon. So, as the current update, I have modified it as the developer mode of the library.
Thank you for reporting it.