Skip to content

Fix AudioProcessor worker failing on relative media URLs#157

Merged
mfwolffe merged 1 commit intoLab-Lab-Lab:mainfrom
espadonne:fix/worker-relative-url
Apr 2, 2026
Merged

Fix AudioProcessor worker failing on relative media URLs#157
mfwolffe merged 1 commit intoLab-Lab-Lab:mainfrom
espadonne:fix/worker-relative-url

Conversation

@mfwolffe
Copy link
Copy Markdown
Collaborator

@mfwolffe mfwolffe commented Apr 2, 2026

Web Workers don't have the page's base URL context, so fetch("/media/...") inside the AudioProcessor worker blob fails with "not a valid URL". This broke bassline import in Activity 3 — the worker couldn't fetch the proxied media file, the fallback also failed, and the clip ended up with no waveform or duration.

Fix: convert relative URLs to absolute (window.location.origin + url) before passing to the worker. The resolved URL still routes through the Next.js /media/ rewrite proxy.

@mfwolffe mfwolffe requested a review from hcientist April 2, 2026 16:23
@mfwolffe mfwolffe merged commit be1e26f into Lab-Lab-Lab:main Apr 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants