URL is not defined
when adding AudioWorklet in Preact preset
#9606
Labels
URL is not defined
when adding AudioWorklet in Preact preset
#9606
Describe the bug
I created a Preact project using
yarn create vite
and I'm importing my AudioWorklet class as an url using the?url
import syntax. When i try to attach that worklet to my AudioContext i get anUncaught ReferenceError: URL is not defined
in vite's file calledclient.ts
, in this line:const importMetaUrl = new URL(import.meta.url)
This error occurs when i call
AudioContext.audioWorklet.addModule(importedWorkletUrl)
Do you know what could be causing this problem or if there's any way to successfully use worklets in this setup?
Reproduction
https://github.com/pyotrr/vite-audio-worklet-repro
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: