grimmdude / MidiPlayerJS

♬ MIDI parser & player engine for browser or Node. As a parser converts MIDI events into JSON. Works well with single or multitrack MIDI files.
https://grimmdude.com/MidiPlayerJS/
MIT License
359 stars 52 forks source link

Browserify complaining #47

Closed binyamin closed 5 years ago

binyamin commented 5 years ago

I'm trying to use MidiPlayerJS in the browser. I installed it as an npm module, but when I use browserify to compile it, it gives me the following error:

Error: Cannot find module './utils' from 'C:\Users\bgree\Documents\chordy\node_modules\midi-player-js\browser'
...

I checked the module, and, sure enough, it's requiring a module (utils) which doesn't exist. Please advise.

grimmdude commented 5 years ago

Hi @b3u,

browser/midiplayer.js is meant to be used in the browser via script tag as is, so guessing that's why you're seeing that issue. Try using the main entry point for the module; build/index.js.

-Garrett

binyamin commented 5 years ago

Thanks