Sheetjs: Buffer is not a constructor

Created on 14 Aug 2018  路  6Comments  路  Source: SheetJS/sheetjs

I have updated to angular 6 and node 8.11 and I have the following error:
ERROR Error: Uncaught (in promise): TypeError: Buffer is not a constructor
it is in file cpexcel.js

if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };

Most helpful comment

when I comment out //var Buffer..., I counter a new error: buffer nod defined
@AsmaAshfaq219

All 6 comments

@cipci-s can you share a small project to reproduce this?

Is this situation resolved? I am still getting this issue.

Is there any solution to this?

I just resolved the issue,
The following script was used when I upgraded to 6x in my index.html file

Comment out
//var Buffer = Buffer || [];

Works fine for me now

@AsmaAshfaq219 Thanks for that!

when I comment out //var Buffer..., I counter a new error: buffer nod defined
@AsmaAshfaq219

Was this page helpful?
0 / 5 - 0 ratings