standardized-audio-context: Cannot assign to read only property 'Symbol(Symbol.hasInstance)' of function

Hi! Thank you for all your work on this library.

I’m trying to use Tone.js on a project, which includes this library as a dependency. When I try to build my project using Babel I get the following error:

TypeError: Cannot assign to read only property ‘Symbol(Symbol.hasInstance)’ of function 'function AudioBuffer(options){if(nativeOfflineAudioContextConstructor===null){throw new Error(‘Missing the nati…<omitted>…;}’

I initially logged the issue in Tone.js’s repo, but I think the issue is actually here.

Babel seems to prefer defineProperty when assigning hasInstance, and crashes otherwise. Would you accept a Pull Request changing the Symbol.hasInstance assignments in audio-buffer-constructor.ts and periodic-wave-constructor.ts to use defineProperty instead?

Thanks,

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@chrisguttandin sorry for the delay; it’s taken me ages to get around to upgrading Gatsby to the latest version. This issue seems to be fixed now that Gatsby has moved to MDX v2 🎉 thanks for sticking with this, and for all the work you put into this library!