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

Problem with nan - AccessorSignature #230

Open
RichardFoss opened this issue Oct 7, 2022 · 7 comments
Open

Problem with nan - AccessorSignature #230

RichardFoss opened this issue Oct 7, 2022 · 7 comments

Comments

@RichardFoss
Copy link

I have been using this package very successfully for a few years, thank you!
Recently I updated to node v 18.10.0 and nw v0.69.1. When I rebuild:
nw-gyp rebuild --target=0.69.1 --arch=x64
I get:
../../nan/nan_callbacks.h:55:23: error: no member named 'AccessorSignature' in namespace 'v8'
typedef v8::Localv8::AccessorSignature Sig;
~~~~^
And so the build fails. I have tried putting this into the midi package.json:
"overrides": {
"nan": "github:jkleinsc/nan#remove_accessor_signature"
},
But still get the same message. Any suggestions?

@Julusian
Copy link

Julusian commented Oct 7, 2022

Do you fancy giving https://www.npmjs.com/package/@julusian/midi a try? Its a api compatible rewrite on node-api #228. I don't know if it will work with nw (I've never used nw myself), but Im happy to get it working if it is wanted

@RichardFoss
Copy link
Author

Thank you very much! I will try it and let you know how it goes. I am using both Mac and PC.

@RichardFoss
Copy link
Author

I'm getting this error message when I use the module. I'm not clear on the binding mechanism. If you have an immediate solution, that would be great, otherwise I will study binding! I'm testing on a Mac.

Uncaught Error: Failed to find binding for midi
    at loadBinding (/Users/csrf/Documents/Git-Repos/ImmerGo-Presonus-SL/immergo-presonus-sl/node_modules/pkg-prebuilds/bindings.js:91:27)
    at Object.<anonymous> (/Users/csrf/Documents/Git-Repos/ImmerGo-Presonus-SL/immergo-presonus-sl/node_modules/@julusian/midi/midi.js:1:47)
    at Module._compile (node:internal/modules/cjs/loader:1173:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1233:10)
    at Module.load (node:internal/modules/cjs/loader:1051:32)
    at Module._load (node:internal/modules/cjs/loader:892:12)
    at Module.require (node:internal/modules/cjs/loader:1075:19)
    at require (node:internal/modules/cjs/helpers:98:18)
    at self.require (<anonymous>:11:26)
    at self.require (<anonymous>:11:26)

@Julusian
Copy link

Julusian commented Oct 7, 2022

The binding is the native component, which you were having issues building at the start of this issue thread.

Oh, and I can immediately see the issue, its looking for a nw version of the file (separate to the node/electron version), which I havent prebuilt..
Have you tried that nw-gyp rebuild --target=0.69.1 --arch=x64 to see if it helps?

@RichardFoss
Copy link
Author

Apologies for the slow reply - had to leave this for a while.
I have done the rebuild and it works! Thank you VERY much for your module and for all your help! I can get MIDI input and output ports and display them. I still need to test transmission and receipt of messages. It's a bit late here now - I will test over the weekend and let you know how it goes. Thanks again!

@Julusian
Copy link

Julusian commented Oct 8, 2022

I've spent a couple of hours looking into what I can do on this and I am not sure how best to proceed

It looks like it would be possible to automate making prebuilt binaries for nwjs, but for windows that does require modifying a file from node-gyp which sounds like it is going to be very fragile and fiddly.
If this works, I expect this could be done as one binary used by all of node, electron and nwjs.

Or perhaps nwjs is a small enough user base to not worry about it for now, and leave it as expected that you will need to run nw-gyp rebuild --target=0.69.1 --arch=x64

I have opened an issue to discuss whether that file hack is necessary or if it could be upstreamed, which would be the ideal solution but will take time to happen if it ever does.

@RichardFoss
Copy link
Author

Thanks for all the work on this issue! From my point of view, doing the rebuild is fine. Just need to document it, so I remember :)

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