Uncaught TypeError: XLSX.read is not a function with dojo AMD #1937
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#1937
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi
When I use xlsx.js along with dojo (js.arcgis.com/3.14compact/) and AMD i am getting below error
Uncaught TypeError: XLSX.read is not a function
at ProcessExcel (ADBInitExcel.js:52)
at FileReader.reader.onload (ADBInitExcel.js:26)
The html file and the script file is attached below
InitialPage.zip
The fix is fairly straightforward and we'll accept a PR: the define call in https://github.com/SheetJS/sheetjs/blob/master/bits/99_footer.js#L6 should be
Hi SheetJSDev
It worked. Thanks for the immediate support
This doesn't work. I've downloaded the file and referenced it in my project. Dojo doesn't allow this to be ran through its AMD system.
tl;dr When
async
is enabled, Dojo will only understand the namexlsx
. You have to adjust the package settings indojoConfig
to tell it to use the script.https://docs.sheetjs.com/docs/getting-started/installation/amd#dojo-toolkit installation for sync and async loaders
https://docs.sheetjs.com/docs/demos/legacy#dojo-toolkit discussion
https://docs.sheetjs.com/dojo/read.html fetches data with
dojo/request/xhr
and parses withXLSX.read
https://docs.sheetjs.com/dojo/read.html fetches JSON data and writes a workbook with
XLSX.writeFile