music-metadata-browser: RangeError: offset is not uint

Hi there,

I’m loving music-metadata-browser. Nice work!

Every so often, though, when processing a file, it throws an error like the below for certain songs:

RangeError: offset is not uint
    at checkOffset (index.js:1165)
    at Uint8Array.readUInt32LE (index.js:1218)
    at ID3v24TagMapper.postMap (ID3v24TagMapper.js:173)
    at ID3v24TagMapper.mapGenericTag (GenericTagMapper.js:78)
    at CombinedTagMapper.mapTag (CombinedTagMapper.js:42)
    at MetadataCollector.toCommon (MetadataCollector.js:239)
    at MetadataCollector.addTag (MetadataCollector.js:102)
    at ID3v2Parser.addTag (ID3v2Parser.js:195)
    at ID3v2Parser.parseId3Data (ID3v2Parser.js:189)

When I say “certain songs” I mean mp3 files, and that the error is consistent, in that it will always happen for some files and it will never happen on others.

What are some things to look at with regards to the file to determine why a problematic file is causing the error?

I’ve read through issue #15 but couldn’t quite figure out how to troubleshoot the issue.

I dropped some of the files in question on the Audio Tag Analyzer, and compared those to “known good” files, but I’m not seeing thing that sticks out.

Any advice would be greatly appreciated.

P.S. I’m using "music-metadata-browser": "^1.1.1" in a create-react-app

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 31 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Workaround released in music-metadata-browser v1.2.2.

Does this work for you guys, without the yarn buffer resolution?

Hi @Borewit , thanks for your continued efforts on this cool project.

I just removed node_modules, removed buffer from packages.json, removed yarn.lock, and bumped mm-b to v1.2.2, then did a clean npm install.

I also removed the shim bits in the app.

And… 🎉 !

Excellent. Yes, I did a fresh install to my dumb project with the update of music-metadata-browser to 1.2.2, without the yarn buffer resolution and confirm that it works.
Now I can continue using npm without having to install yarn. Big thanks.

I managed to fix my React app, using yarn package manager, in PR: Borewit/music-metadata-react#2

Hi @Borewit sorry for the delay, I got distracted.

Please find a (hopefully) clean repo here.

My flailing can be found at /src/App.js on line 28

I look forward to your insight on how to do the shim right.