Borewit / music-metadata

Stream and file based music metadata parser for node. Supporting a wide range of audio and tag formats.
MIT License
983 stars 93 forks source link

`parseFile` not working with Bun runtime #2236

Closed DavNej closed 2 months ago

DavNej commented 2 months ago

Is there an existing issue for this?

music-metadata version

10.3.1

Current Behavior

Using Bun as runtime, the console remains idle when parseFile is called.

Here is the following code. This code works well with npm and tsx.

Also, on line 1, I get the following error from typescript: Module '"music-metadata"' has no exported member 'parseFile'

import { parseFile } from 'music-metadata'
import { inspect } from 'util'

const filePath = '/path/to/file.mp3'

async function main() {
  try {
    const metadata = await parseFile(filePath)

    console.log(inspect(metadata, { showHidden: false, depth: null }))
  } catch (error) {
    console.error('Error parsing metadata:', error.message)
  }
}

await main()

Expected Behavior

Should read properly the metadata of the given file

Attached audio sample?

minht11 commented 2 months ago

Bun explicitly has a policy if it works in Node but not in Bun, it is a Bun bug, you should report it there.