2024 Jun 13 7:52 PM - edited 2024 Jun 13 7:56 PM
Hi,
I am using xlsx.full.min.js file in a File upload project. The xlsx.full.min.js is included in a folder under webapp and referencing it correctly.
When I run the file locally in SAP BAS it's working fine. But when I deployed and ran from Fiori Launchpad it's throwing error as XLSX.read is not a function.
I tried /* global XLSX:true */ at the top of the controller. But the issue still occurs.
Request clarification before answering.
For me this works, I am not referring to the file in the controller, I can access XLSX globally.
"js": [ { "uri": "libs/xlsx.js" } ],I'm using this CDN - https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.0/xlsx.js
I was using the CDN first, but later I copied the code locally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this but it didn't work for me. Below solution worked for me:
https://community.sap.com/t5/technology-q-a/howto-use-3rd-party-lib-with-content-security-policy-omi...
When you run this application in FLP, can you check the network tab in developer tools and search for this file? Also, have you specified this in the manifest.json under resources?
"js": [
{
"uri": "libs/xlsx.full.min.js"
}
]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd suggest not to use a relative path, but the full namespace instead. The file path is rendered differently, check out the network tab for the 404 not found lib file how it is being rendered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.