Borewit
Borewit
I think you need to polyfill: - [buffer](https://www.npmjs.com/package/buffer) - [stream](https://www.npmjs.com/package/readable-stream) [music-metadata-browser](https://github.com/Borewit/music-metadata-browser) is CommonJS module. Eventually I would like to provide an ES-Module [music-metadata](https://github.com/Borewit/music-metadata) also works in client side environment. Closes...
One of the things you may run into using the ESM is the way Node.js modules are imported. They use the `node:` URL prefix. I am not sure if that...
Hi @lennyanders, I had a look to your [music-metadata-with-polyfills](https://github.com/lennyanders/music-metadata-browser-8-with-vite-3/tree/music-metadata-with-polyfills). So that is the ESM way music-metadata. That's great, first time I think I actually see it working in the browser!...
Which version of music-metadata? Are you using it in Node.js or client (browser) side?
@julianpoemp [music-metadata](https://github.com/Borewit/music-metadata) version 8 is a pure ES-Module (so no longer a CommonJS module), therefor attempts rewriting `import` to `require` will fail.
@subframe7536, electron as kind of mix between Node.js ([main](https://www.electronjs.org/docs/latest/tutorial/process-model#the-main-process)) & Chromium ([renderer](https://www.electronjs.org/docs/latest/tutorial/process-model#the-renderer-process)). It looks like your import is following the `default` path instead of the `node` path in the [conditional...
So you have imported `"default": "./lib/core.js" ` which defines `parseBuffer` & `parseStream`. Via the main process, as this is comparable to Node.js, you should be automatically importing `"node": "./lib/index.js"`, which...
That's what I thought, but since you have been able to use some function I thought maybe something changed. v7.13.0 is functional identical and up to date, so that's perfectly...
I close this issue, as in either case, appears to me as incompatibility issues with ESM modules in the source project environment.
I don't know what `req.file.buffer` is, but if `buffer` is a [Node.js Buffer](https://nodejs.org/api/buffer.html) and filled with the entire audio file content you can use [`parseBuffer()`](https://github.com/Borewit/music-metadata#parsebuffer-function) to extract metadata. Alternatively, if...