"Cannot find file xl/worksheets/sheet.xml in zip" at XLSX.read #3292

Closed
opened 2025-03-17 15:11:45 +00:00 by jumnichi_kose_pc · 5 comments
  • Abstract;
    An exception "Error: Cannot find file xl/worksheets/sheet.xml in zip " was thrown and suppressed at XLSX.read.

  • Reproduction Method;
    In the EDGE developer console,with source code tracking enabled,
    select an xlsx workbook containing only the Japanese display name '帳 票(1)'
    for the first sheet using the in the browser's HTML screen,
    and execute XLSX.read with the reproduction code mentioned earlier.

    The expected behavior is to read "xl/worksheets/sheet1.xml",
    but the module downloaded from CDN.sheet.com has a hardcoded file path "xl/worksheets/sheet.xml" (not sheet1),
    which seems to be attempting to read the wrong file.

 var x = Yr(e, "xl/worksheets/sheet.xml", true) ? 1 : 0;

However, after the aforementioned exception is suppressed, it appears that "xl/worksheets/sheet1.xml" is also read.
This exception makes debugging promise/async functions very troublesome

  • Attached file;
  1. Please also refer to the attached image as a screenshot of the issue when it occurred.
  2. The attached file 'theWorkbook.xlsx' is a file that can reproduce the issue.

  • Reproduction code;
const file = inputEvent.target.files[0];
            return (new Promise((resolve1, _reject1) => {
                this.setState({ infoMessages: "読み込み中...", selected_file: file, running: true, alertType: "info", alertVisible: true },
                    () => {
                        const reader = new FileReader();
                        reader.onload = (e) => {
                            const arrayBuffer = e.target?.result as ArrayBuffer;
                            const data = new Uint8Array(arrayBuffer);
                            const workbook = XLSX.read(data, { type: 'array' });
                            console.log(file.name + "のアップロード終わり", workbook);
                            resolve1(workbook);
                        };

                        reader.readAsArrayBuffer(file);
                        console.log(file.name + "のアップロード始め");
                    }
                );
            }))

best reguards.

junichi-kose @ peer-connect.co.jp

* Abstract; An exception "Error: Cannot find file xl/worksheets/sheet.xml in zip " was thrown and suppressed at XLSX.read. * Reproduction Method; In the EDGE developer console,with source code tracking enabled, select an xlsx workbook containing only the Japanese display name '帳 票(1)' for the first sheet using the <input type=file> in the browser's HTML screen, and execute XLSX.read with the reproduction code mentioned earlier. The expected behavior is to read "xl/worksheets/sheet1.xml", but the module downloaded from CDN.sheet.com has a hardcoded file path "xl/worksheets/sheet.xml" (not sheet1), which seems to be attempting to read the wrong file. ``` var x = Yr(e, "xl/worksheets/sheet.xml", true) ? 1 : 0; ``` However, after the aforementioned exception is suppressed, it appears that "xl/worksheets/sheet1.xml" is also read. This exception makes debugging promise/async functions very troublesome * Attached file; 1. Please also refer to the attached image as a screenshot of the issue when it occurred. 2. The attached file 'theWorkbook.xlsx' is a file that can reproduce the issue. ----------------------------------------- * Reproduction code; ``` const file = inputEvent.target.files[0]; return (new Promise((resolve1, _reject1) => { this.setState({ infoMessages: "読み込み中...", selected_file: file, running: true, alertType: "info", alertVisible: true }, () => { const reader = new FileReader(); reader.onload = (e) => { const arrayBuffer = e.target?.result as ArrayBuffer; const data = new Uint8Array(arrayBuffer); const workbook = XLSX.read(data, { type: 'array' }); console.log(file.name + "のアップロード終わり", workbook); resolve1(workbook); }; reader.readAsArrayBuffer(file); console.log(file.name + "のアップロード始め"); } ); })) ``` best reguards. junichi-kose @ peer-connect.co.jp
Owner

Can you reproduce the issue using the demo in https://docs.sheetjs.com/docs/#preview-a-workbook-on-your-device ? to test, in the live example under "Preview a workbook on your device", tap "Choose File" and select the file. It will display the data from the first worksheet.

Can you reproduce the issue using the demo in https://docs.sheetjs.com/docs/#preview-a-workbook-on-your-device ? to test, in the live example under "Preview a workbook on your device", tap "Choose File" and select the file. It will display the data from the first worksheet.

Thanks for the reply.

"Preview a workbook on your device" can reproduce the issue.

image
Thanks for the reply. "Preview a workbook on your device" can reproduce the issue. <img width="1436" alt="image" src="/attachments/f222389d-d825-4d25-a0f5-eb8b46b36355">
262 KiB

re-reproduce the issue.

image
re-reproduce the issue. <img width="1395" alt="image" src="/attachments/b888993e-3069-4cdd-9f80-4f5cbe8cb545">
196 KiB

EDGE exteentions are:
image

EDGE exteentions are: <img width="836" alt="image" src="/attachments/132883f5-bd8a-4bfe-af64-9b907f320a08">
123 KiB

It's unfortunate. "Normal Edge" works, "Normal Edge for Business" works, and "Edge for Business + Norton Safe Web" works in local tests. If the only variable here is the HP Wolf Security Extension, the issue lies with HP.

image

Edge for Business
Version 134.0.3124.68 (Official build) (arm64)

It's unfortunate. "Normal Edge" works, "Normal [Edge for Business](https://www.microsoft.com/en-us/edge/business/download)" works, and "Edge for Business + [Norton Safe Web](https://microsoftedge.microsoft.com/addons/detail/norton-safe-web/bdaafgjhhjkdplpffldcncdignokfkbo)" works in local tests. If the only variable here is the [HP Wolf Security](https://microsoftedge.microsoft.com/addons/detail/hp-wolf-security-extensio/aoganjpeihhkhippgnniaclfocnihgln) Extension, the issue lies with HP. ![image](/attachments/6995ddd0-2760-4da4-86fa-ba67150918dd) Edge for Business Version 134.0.3124.68 (Official build) (arm64)
263 KiB
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3292
No description provided.