typeerror in node version 4 and lower verison #1150
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#1150
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?
What node version are you using? According to the last test run https://travis-ci.org/SheetJS/js-xlsx/builds/386754693 this worked in 0.8.x, 0.10.x, 0.12.x and 4.x (there's also a test run for each major version 5-10)
@SheetJSDev ,my node version is 4.4.3
So I can reproduce in node 4.0.0-4.4.7, but it seems to have been fixed in 4.5.0.
The NodeJS CHANGELOG https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.5.0 suggests that the PR https://github.com/nodejs/node/pull/7562 fixed the problem in between versions.
We had to make the shift to
Buffer.from
(used to benew Buffer
) because node 10 decided to add a deprecation warning :( .This issue does not affect 0.12.x because the code falls back on a
Buffer.from
shim. It also does not affect the 6.x or 8.x or 10.x series.Are you able to upgrade to 4.5.0+ or should we add a version check?
@SheetJSDev ,thanks ,but i can't decide the version on the production environment. let me think it
We're slowly updating the related projects @gabyidong .
Summary:
Buffer.from
had a different interface in node versions4.0.x
-4.4.x
. UnfortunatelyBuffer.from
is non-writable, so we can't just assign to it like we can in0.12
and lower.In the dependencies, we've fixed this by making a separate
Buffer_from
variable, and we will be doing the same here