diff --git a/.changeset/khaki-needles-join.md b/.changeset/khaki-needles-join.md new file mode 100644 index 000000000..fff480be9 --- /dev/null +++ b/.changeset/khaki-needles-join.md @@ -0,0 +1,5 @@ +--- +'@flatfile/plugin-xlsx-extractor': patch +--- + +This release reattempts to read XLSX files that may have emitted an error that could be handled. diff --git a/plugins/xlsx-extractor/src/parser.ts b/plugins/xlsx-extractor/src/parser.ts index 642aa5cc0..0867a5d1f 100644 --- a/plugins/xlsx-extractor/src/parser.ts +++ b/plugins/xlsx-extractor/src/parser.ts @@ -38,7 +38,14 @@ export async function parseBuffer( 'File is too large to parse. Try converting this file to CSV.' ) } - throw e + + // Try reading the file again without the 'WTF' option. + workbook = XLSX.read(buffer, { + type: 'buffer', + cellDates: true, + dense: true, + dateNF: options?.dateNF || undefined, + }) } const sheetNames = Object.keys(workbook.Sheets)