Workers Runtime API availability in Pages w/Sveltekit

Attempting to use the HTMLRewriter API within a sveltekit endpoint (/functions folder is ignored in sveltekit). While cloudflare workers has no issues, developing with cloudflare pages throws undefined errors when using said API.

What am I doing wrong? I'm having a tough time getting my head around understanding the pages and workers synergy, especially when using a framework.
Was this page helpful?