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

midi is read-only (typescript error?) #3

Open
glend1 opened this issue Mar 10, 2022 · 4 comments
Open

midi is read-only (typescript error?) #3

glend1 opened this issue Mar 10, 2022 · 4 comments

Comments

@glend1
Copy link

glend1 commented Mar 10, 2022

when i try to use the following i get an error in my ide midi is read-only.

WMT.midi = false;

I dont know why this is happening, but the code seems to complete anyway because midi is failing as expected. so I assume this is a problem with the typescript definition.

@jazz-soft
Copy link
Owner

Never tried in from Typescript, only from JavaScript...
One possible solution is not to declare WMT const.
If you find any better Typescript-like solution, please let me know!

@glend1
Copy link
Author

glend1 commented Mar 10, 2022

im just importing it.

import * as WMT from 'web-midi-test';

@jazz-soft
Copy link
Owner

Then just ignore the warning.
I'll try to come up with some better solution...

@raphaelsiz
Copy link

raphaelsiz commented Jun 28, 2024

I had a different error ("MidiSrc is not a constructor") which was resolved when I changed my import statement from the above to this:

import WMT from 'web-midi-test'

To test if the two are related, I changed my import statement back to what's in the README and tried setting WMT.midi myself, and also got an error ("Object is not extensible"). When I changed the import statement to import WMT again, it worked as expected.

TL;DR: I think the import statement listed in the README for TypeScript doesn't work, at least in our two cases. The import statement I listed above worked for my different situation, and it also worked when I replicated OP's situation to the best of my ability.

Might be worth a change to the README, but I wasn't using TypeScript so I don't know for sure.

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

3 participants