Closed Bug 1636121 Opened 4 years ago Closed 3 months ago

audioWorklet.addModule aborts with Error: Module resolve hook not set

Categories

(Core :: Web Audio, defect, P3)

76 Branch
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: johannes.feulner, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

Start FF 76.0 (64-Bit)
Navigate to https://ssc.scorio.com/localtest.html
Click on link "Play_Rock ..."

Actual results:

The song is not playing
The console displays:
Error: Module resolve hook not set self-hosted:1235:1
CallModuleResolveHook self-hosted:1235
InnerModuleInstantiation self-hosted:1438
declarationInstantiation self-hosted:1408
AbortError: The operation was aborted. midi.js:1

Expected results:

The song should play via speakers.

Note 1: The implementation of this MIDI-FIle player without AudioWorklet runs well in FF. Can be checked at https://www.midijs.net
Note 2: The AudioWorklet version works well with Google Chrome Version 81.0.4044.129 (Offizieller Build) (64-Bit)

The AudioWorklet (https://ssc.scorio.com/lib/libtimidity-for-worklet.js) was compiled from C source code with EMSDK 1.39.14

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Because this bug's Severity is normal and has not been changed, and this bug's priority is -- (none,) indicating it has has not been previously triaged, the bug's Severity is being updated to -- (default, untriaged.)

Severity: normal → --

The same problem (Error: Module resolve hook not set self-hosted:1235:1) has afflicted the Google Web Audio Samples https://googlechromelabs.github.io/web-audio-samples/audio-worklet/design-pattern/wasm/

I found a workaround for this problem by changing the setup to not use ES6 modules at all.

Google's WebAudio Worklet sample includes the emscpripten compiled code via ES6 import into the AudioWorkletProcessor JavaScript file.

I turned it around and append (via --post-js) the AudioWorkletProcessor JavaScript file into the emscripten compiled code. So this works without ES6 modules.

Good news: The worklet runs now fine in Firefox 76 which seems to currently not support ES6 modules in worklets. It also works in Google Chrome.

A quick demo of our MIDI file player with worklet: https://ssc.scorio.com/localtest.html

Wishlist:

  • support ES6 modules in worklet
  • make worklets visible and debuggable in FF dev console
Component: Audio/Video: Playback → Web Audio

Bug 1572644 tracks the feature needed here.
I'll leave this open in case there's something we can do about improving the error message in the mean time.

Bug 1458445 tracks debugger support for worklet scripts.

Blocks: audioworklet
Severity: -- → S4
Status: UNCONFIRMED → NEW
Depends on: 1572644
Ever confirmed: true
Priority: -- → P3

Hi Karl, I'm triaging some old module related bugs and I was wondering if we could safely close this bug now? Thanks!

Flags: needinfo?(karlt)

This has been fixed by bug 1572644, we can close this.

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Flags: needinfo?(karlt)
You need to log in before you can comment on or make changes to this bug.