The FinalizationRegistry is part of undici.
The weird part is undici shouldn’t be required at all since I have enforced native fetch as per the module docs and uses node 22 in build settings. Getting Started | YouTube.js
Yeah I was aware of that branch, but I did not see any deploys from that branch on your site which is why I asked.
Anyways, the issue seems to be solvable by patching undici directly. I modified your build command (on my test site) to:
npm run build && sed -i -e '1iglobalThis.global = globalThis\' ./node_modules/undici/lib/core/connect.js
Basically, I’m adding the same line that I asked others in that thread, except this time I’m adding the line directly in undici insted of your code. The site then deploys successfully.