Uncaught TypeError: XLSX.read is not a function while uploading an Excel File in SAPUI5 application

I am trying to read a .xlsx file in my SAPUI5 application using FileReader api.
My requirement is to read the content of the Excel. For this, I have used xlsx library to read the Excel file content.

Here I already added the library in my project and file is also getting loaded and can be seen in my project structure also available in Networks tab as I checked, before usage of the XLSX object, here is my code. Getting error at line oWorkbook = XLSX.read(aData, { type: ‘array’ })

if (sFile && window.FileReader) {
                let oReader = new FileReader();
                oReader.onload = function (e) {
                    let oArrayBuffer = e.target.result,
                        aData = new Uint8Array(oArrayBuffer),
                        oWorkbook = XLSX.read(aData, { type: 'array' }),
                        sSheetName = oWorkbook.SheetNames[0],
                        sSheet = oWorkbook.Sheets[sSheetName],
                        oExcelData = XLSX.utils.sheet_to_json(sSheet, { header: 1 });
                    if (oExcelData.length < 2) {
                        MessageBox.show(oResourceModel.getText("customerData.upload.emptyMsg"), {
                            icon: MessageBox.Icon.ERROR,
                            title: oResourceModel.getText("messageBox.title.error")
                        });
                    } else if (!this._validateColumns(oExcelData[0])) {
                        MessageBox.show(oResourceModel.getText("customerData.upload.columnsError"), {
                            icon: MessageBox.Icon.ERROR,
                            title: oResourceModel.getText("messageBox.title.error")
                        });
                    } else if (this._validateData(oExcelData)) {
                        this._uploadCustomerData(oExcelData);
                    }
                }.bind(this);
                oReader.readAsArrayBuffer(sFile);
            }

The feature works perfectly on my local system, but when I deploy it to the Development system,
the XLSX object is getting initialized as an empty object, causing the functionality to fail.

I am using “xlsx”: “0.15.1” version

I’m not sure which dependency I might be missing or if there’s a different approach I should consider.

Or is there any other way of initializing the XLSX object as it is not getting self-executed.

I already tried with latest version 0.18.5 still the same issue.
Till xlsx version 0.12.13 the functinality is working fine on both Local and Development system but after this version XLSX object is not getting initialized properly on Dev system but working perfectly on Local system.