From 3108fbd0a10c178b91023ef82b1d653e53bb574c Mon Sep 17 00:00:00 2001 From: Alexander Balasyan Date: Mon, 21 Sep 2020 08:47:54 +0300 Subject: [PATCH] Passed arguments everywhere to buffer.readUInt32BE() to avoid some errors https://github.com/webpack/node-libs-browser/issues/93 Webpack 4 now is a stable version. It uses node-libs for Buffer polyfill that is not completely compatible with the nodejs implemintation. In node-libs a lot of optional arguments are required, so we get an offset error in the browser calling buffer.readUInt32BE without an argument. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9ab76ad..5dbcf9b 100644 --- a/index.js +++ b/index.js @@ -1105,7 +1105,7 @@ NodeID3.prototype.readPopularimeterFrame = function(frame) { if(counterIndex < frame.length) { let value = frame.slice(counterIndex, frame.length) if(value.length >= 4) { - tags.counter = value.readUInt32BE() + tags.counter = value.readUInt32BE(0) } } } @@ -1266,4 +1266,4 @@ NodeID3.prototype.readChapterFrame = function(frame) { } return tags -} \ No newline at end of file +}