Angular Electron & AudioWorklet.addModule() error DOMException: The user aborted a request

Viewed 533

When starting the app in development mode no problems, on build I get the error...

private record(mediaStream: MediaStream): void {
    this.audioContext = new AudioContext();

    this.audioContext.audioWorklet.addModule('./../../../assets/js/converter-processor.js').then(() =>  {
        // code
    }
    // code
}

Checked converter-processor.js for errors (none and does not use external modules).
Seems the file is not found?

Tried different solutions found on StakOverflow, no success ... :(

1 Answers

yes it seems such error happens when file is not present - it can't load.

ERROR Error: Uncaught (in promise): AbortError: The user aborted a request.

I used "assets" folder and it works.

await this.audioContext.audioWorklet.addModule(
    '/assets/audio-level-processor.js'
  );
Related