abcjs
abcjs copied to clipboard
TypeError on initial playback after upgrading to 6.4.0
After upgrading from version 6.3.0 to 6.4.0 (by changing the version in package.json, deleting node_modules/, and reinstalling), I'm having an issue with playback.
When I click the play button I get an exception. Here's the traceback:
create-synth.js:318 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'swing')
at create-synth.js:318:21
at new Promise (<anonymous>)
at CreateSynth.self.prime (create-synth.js:302:10)
at ScorePlayback.init (ScorePlayback.ts:65:23)
In case it isn't clear from the traceback, I have my own init method. Here's the relevant portion:
const midi_buffer = new ABCJS.synth.CreateSynth();
await midi_buffer.init({
visualObj: this.rendered_score[0],
// debugCallback: console.debug,
});
await this.controller.setTune(this.rendered_score[0], false);
await midi_buffer.prime();
In midi_buffer#prime, self.options is undefined, precipitating the exception.
If I click the play button a second time, no exception is raised and playback proceeds as normal except that timing callbacks aren't called. But that might be due to an unrelated issue.
Downgrading to 6.3.0 resolves the issue.
Sorry! I quickly fixed it: upgrade to 6.4.1.