GoogleChromeLabs / audioworklet-polyfill

🔊 Polyfill AudioWorklet using the legacy ScriptProcessor API.
https://googlechromelabs.github.io/audioworklet-polyfill/
Apache License 2.0
196 stars 20 forks source link

Worklet script must be an ES module script #28

Open kazssym opened 4 years ago

kazssym commented 4 years ago

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 commented 4 years ago

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

kazssym commented 4 years ago

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.