excel2table icon indicating copy to clipboard operation
excel2table copied to clipboard

rendering a blob gives RuntimeError: unreachable

Open correalucas opened this issue 5 years ago • 0 comments

Hi, I was trying to render a xlsx as a blob but without success. In every attempt this RuntimeError: unreachable error shows up: Captura de Tela 2020-07-09 às 13 37 28

here is what i tried to do:

import { render } from 'excel2table';
function init() {
  const url = '[url_to_xlsx_file]';
  
  getBlob(url).then((blob) => { render('#xlsx-preview', blob, { scales: true }) });
}

async function getBlob(url) {
  const blob = await fetch(url).then(r => r.blob());
  return blob; // Blob {size: 3410648, type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}
}
init();

i tried to render a URL.createObjectURL(blob) too, but it gave me the same error.

It's something that i'm doing wrong?

Thanks. Regards.

correalucas avatar Jul 09 '20 13:07 correalucas