audioworklet-polyfill icon indicating copy to clipboard operation
audioworklet-polyfill copied to clipboard

Worklet script must be an ES module script

Open kazssym opened this issue 4 years ago • 2 comments

https://github.com/GoogleChromeLabs/audioworklet-polyfill/blob/8f4123163fe36f4f5453894f847c6d541e56b074/src/realm.js#L36

Supplied worklet modules must be loaded as module scripts according to https://drafts.css-houdini.org/worklets/#code-idempotency.

kazssym avatar Aug 25 '20 06:08 kazssym

It probably needs script.type = 'module' after the element creation.

kazssym avatar Aug 25 '20 06:08 kazssym

It probably needs script.type = 'module' after the element creation.

I was wrong. I have learned module scripts cannot be eval()ed. It must be rewritten using import() somehow.

kazssym avatar Aug 26 '20 06:08 kazssym