abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

TypeError on initial playback after upgrading to 6.4.0

Open mssever opened this issue 1 year ago • 1 comments

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.

mssever avatar Jun 18 '24 00:06 mssever

Sorry! I quickly fixed it: upgrade to 6.4.1.

paulrosen avatar Jun 29 '24 14:06 paulrosen