-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Importation into typescript project returns undefined instead of the expected WebMidi singleton #82
Comments
I should add that importing the interfaces also does show me the descriptions in the ts file, but no matter what the actual lib itself produces 'undefined' instead of the expected WebMidi singleton. |
Update: |
this appears to have been under discussion in #54 . I can confirm that the 'standard' export does NOT work (at least for me) but the other method, using Would you like a PR for this? |
Absolutely. I added this issue to our todo list for version 3. Thanks for reporting it. TypeScript has never been officially tested and supported (even if it does work). |
I like named exports and imports, because they help to be explicit . |
Since there's no more activity here, I'm going to close this. |
@djipco did this get fixed? |
@the-simian Well... I was sorta expecting a PR from you. :-) The thing is that I do not use TypeScript. I welcomed the TypeScript definitions (which were contributed by @mmmveggies) but haven't done any testing. Since With version 3, we will move to a modern ES6-module approach which, I'm guessing, will make this all easier. In any case, I updated the README.md file with the little knowledge that I do have. Feel free to submit something clearer if you have time. |
@djipco I'm in a similar boat as you with Typescript. I normally don't use Typescript, but I am using it in this project to get a feel for it and see what kind of benefits it provides. Honestly, I'm a bit underwhelmed so far, but I need to give it more of a chance I guess. It has mostly been additional friction. I actually don't mind the I'll open a PR if I get around to figuring out why it is not working, but that might be some time. If I do I'll reference this and also update the ReadMe too so there's no miscommunication to others. Again, I am sorry I didn't have the time; it wasn't out of disinterest, but simply couldn't do it with my current workload. |
@the-simian No worries. I'm putting this off until version 3 because I'm also very busy. The important thing is that, for now, there is a solution (albeit not perfect). Cheers! |
I'm still having this issue, and neither |
I tentatively added a By the way, this is in the develop branch for v3. |
This might be an easy one to fix, but I am using typescript and webpack. when I use
import WebMidi from 'webmidi'
I just get
undefined
!What's weird is I do see the type descriptions in my editor
I can see this in the webmidi.d.ts file
Yet, here is the actual output.
using all lowercase (as in the example) also produces identical results.
The text was updated successfully, but these errors were encountered: