Statement of Accounts does not download

When I attempt to download the statement of accounts for a list of customers, ERPNext gives me the following error in the browser console and fails silently.

What could be the cause and is there a solution to this?