This is caused when you pass a string as the final paramater for the qie.sendEmail() function instead of an emailAttachmentMap.
You need to create an emailAttachmentMap and then add your attachments to this map before calling the qie.sendEmail(). Once you have done this, you will pass the emailAttachmentMap as the final paramater in the call.
var attachmentMap = qie.newEmailAttachmentMap();
qie.addEmailAttachment(attachmentMap, 'file.name', source.getBytes());
qie.sendEmail('email@example.com', 'test attachment', 'here is the attachment', attachmentMap);