Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'json_to_sheet') #2933
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2933
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
I'm using the latest version to convert JSON to excel but when i try to convert json to csv I get an error
The error suggests
XLSX
is defined butXLSX.utils
is not. Are you potentially defining the variable XLSX somewhere in your code? For example, the following elicits an error: https://jsfiddle.net/thc5sdv4/First check the developer tools console to see if there are any errors before that specific error.
If there are no other errors,
console.log(XLSX.version)
just before yourXLSX.utils.sheet_to_json
call.PS:
json_to_sheet
expects an array of row objects, so you would callvar ws = XLSX.utils.json_to_sheet(sitelogDataset);
Hi, Im not using XLSX anywhere, when i do console.log(XLSX.verion) I get undefined
I moved me script to the top of the code, I get the version but now i get this error:
The script itself should work. https://sheetjs.com/pres-0.19.3.html is a copy of our tutorial example https://docs.sheetjs.com/docs/getting-started/example#run-the-demo-locally
The error message suggests there is an issue in your deployment. Please share more details here (where is it running? is there a public site that reproduces the issue?) or pop into our Discord
The new error suggests you aren't passing an array of objects.
json_to_sheet
expects an array of JS objects. IfsitelogDataset
is an array of objects, use that directly:If
sitelogDataset
is a large JS object, you have to massage it into an array of objects. https://docs.sheetjs.com/docs/getting-started/example includes an example