hi! do you have some logs to share? perhaps there is a stack trace there so it points to the exact line of code it fails.
it is likely failing to recognize your docx file template as a valid docx (which is basically a zip file with a .docx extension).
what is exactly docxTemplate here? how do you get it? where does it come from? what is the implementation of fileToBase64, it seems the error is here, that the docx is not being serialized properly