Closed nnirror closed 10 months ago
Version 21.0.0 of Node.js has added its own (experimental) global.navigator
object which is meant to be a partial implementation of window.navigator
. This breaks WEBMIDI.js support.
For now, you can run Node version 21.0.0 with the --no-experimental-global-navigator
flag to work around the issue:
node --no-experimental-global-navigator test.js
I will have to look at an option that does not break compatibility. I'll keep you posted.
Version 3.1.7, which is available right now, fixes this problem. If you want to use Node.js v21+, you need to update.
Description
A user of a repository I maintain which includes the WebMIDI npm package reported this issue, which I have been able to duplicate locally.
I cannot run WebMIDI on Node v21.1.0, which was released several weeks ago. I did test that the issue does not occur running Node v18.14.0, nor does it occur running v14.20.0.
So I suspect it must be specific to the very recently released node versions.
If I run the following
test.js
script:const {WebMidi} = require('webmidi');
I get the following error:
Environment: Specify the environment where you are witnessing the problem:
Details Thank you for your time! WebMIDI is amazing.