Closed mxkrn closed 4 years ago
Can you provide the full stack trace?
success!
ReferenceError: performance is not defined
at O.initialize (/home/max/repos/M4L-Syncopate/node_modules/@magenta/music/node/music_vae.js:1:118473)
at Object.<anonymous> (/home/max/repos/M4L-Syncopate/test/sandbox.spec.js:7:6)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
I'm not so good at debugging js unfortunately. @notwaldorf or @cannoneyed do you have time to look into this?
Yeah this is most likely an issue with using a global performance
(which exists in the browser on the window
object but not in Node.js)... It's used all over the place to measure load/inference times throughout the app so I'm a bit surprised that this isn't more pervasive of an issue. I'm happy to look into this a bit more deeply.
Awesome, thanks for addressing this so promptly!
You’re also going to have some problems with fetch btw, which also is no bueno in Node. I have an example on how to shim it on the README: https://github.com/magenta/magenta-js/tree/master/music#in-node
I'm running into this error when trying to initialize MusicVAE in Node.js; example code:
I suppose it makes sense as performance is a window function and is never imported from
perf_hooks