FastestSmallestTextEncoderDecoder icon indicating copy to clipboard operation
FastestSmallestTextEncoderDecoder copied to clipboard

TypeError: Cannot read property 'allocUnsafe' of undefined

Open josharian opened this issue 3 years ago • 3 comments

I'm executing this polyfill in v8, and getting:

TypeError: Cannot read property 'allocUnsafe' of undefined

It's coming from this line:

var NativeBuffer_allocUnsafe = NativeBuffer["allocUnsafe"];

Commenting out that line appears to fix the problem. Perhaps setting up NativeBuffer_allocUnsafe should be guarded by some other conditions? (My javascript is not strong.)

josharian avatar Jun 08 '21 19:06 josharian

Hi, I don't remember why, but we were able to fix this error by importing fastestsmallesttextencoderdecoder/EncoderDecoderTogether.min instead of fastestsmallesttextencoderdecoder.

kosmoz avatar Aug 27 '21 13:08 kosmoz

/EncoderDecoderTogether.min

This worked for me, cheers :)

chrisweight avatar Nov 30 '21 14:11 chrisweight

Falling back to v1.0.21 worked for me.

yunku2002 avatar Nov 10 '22 09:11 yunku2002