Suddenly my script get the error:
Cannot find method setMimeType((class)) (line xxx, file "Code")
It worked well for years, until this afternoon. I didn't modified it at all.
What I've done after:
copied this code from google documentation:
function doGet() {
var feed = UrlFetchApp.fetch('http://xkcd.com/rss.xml').getContentText();
feed = feed.replace(
/(<img.*?alt="(.*?)".*?>)/g,
'$1' + new Array(10).join('<br />') + '$2');
return ContentService.createTextOutput(feed)
.setMimeType(ContentService.MimeType.RSS);
}
pasted it into a new script
given it the proper authorizations
run it
It was ok.
Then:
I obtained the same error:
Cannot find method setMimeType((class)) (line xxx, file "Code")
What could have happened?
Trying to debug my script, a message informed me that my project uses an old Apps Script runtime, and that in order to execute debug I have to upgrade to Javascript V8 engine. After doing that, everything went back to normal. I attach a screenshot (from a different script, in Italian language).