Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't resolve jsmidgen and midi-file-parser #44

Closed
jsphweid opened this issue Dec 8, 2017 · 0 comments
Closed

can't resolve jsmidgen and midi-file-parser #44

jsphweid opened this issue Dec 8, 2017 · 0 comments

Comments

@jsphweid
Copy link

jsphweid commented Dec 8, 2017

I get this error when I try to use this library.

ERROR in ./node_modules/midiconvert/src/Midi.js
Module not found: Error: Can't resolve 'jsmidgen' in '/Users/josephweidinger/git/personal/MidiConvertWrapperAdvanced/node_modules/midiconvert/src'
 @ ./node_modules/midiconvert/src/Midi.js 2:0-35
 @ ./node_modules/midiconvert/src/MidiConvert.js
 @ ./src/main.ts

ERROR in ./node_modules/midiconvert/src/Midi.js
Module not found: Error: Can't resolve 'midi-file-parser' in '/Users/josephweidinger/git/personal/MidiConvertWrapperAdvanced/node_modules/midiconvert/src'
 @ ./node_modules/midiconvert/src/Midi.js 1:0-43
 @ ./node_modules/midiconvert/src/MidiConvert.js
 @ ./src/main.ts

Here are 4 methods to make it work... but they all feel wrong...

  1. If I run the commands:
npm install jsmidgen
npm install midi-file-parser

The errors go away.

  1. Looking at the package.json, I notice that these seemingly important dependencies are only devDependencies. If I fork the project and make them dependencies, it installs both of these automatically and everything is good.

  2. Deleting node_modules/midiconvert/src (forces it to use /build)

  3. Deleting in package.json "module": "src/MidiConvert.js",

So it appears the issue is it is using the src dir and not the bundle when you import. It then fails when it tries to compile Midi.js because of the lines:

import * as Decoder from 'midi-file-parser'
import * as Encoder from 'jsmidgen'

In my opinion, it makes sense to list these things as dependencies and not devDependencies. So I'm going to make a PR and you all can decide.

Great library!

@jsphweid jsphweid changed the title jsmidgen and midi-file-parser can't resolve jsmidgen and midi-file-parser Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants