Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FinalizationRegistry in @react-aria/utils 3.28.0 is unsupported in Cloudflare Workers environment #7882

Open
tobimori opened this issue Mar 6, 2025 · 1 comment · May be fixed by #7885
Open

Comments

@tobimori
Copy link

tobimori commented Mar 6, 2025

Provide a general summary of the issue here

When deploying to Cloudflare Workers environment, the following issue happens since it's not support it:

Uncaught ReferenceError: FinalizationRegistry is not defined
at null.
(file:///[...]/@react-aria/utils/dist/packages/@react-aria/utils/src/useId.ts:29:16)
[code: 10021]

Related to cloudflare/workerd#2906.

It is unlikely that we will ever actually support FinalizationRegistry.

🤔 Expected Behavior?

Should just work.

😯 Current Behavior

See above.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

Deploy any RAC starter project with SSR to CF Workers and you'll see the error.

Version

RAC 1.7.0 / @react-aria/utils 3.28.0

What browsers are you seeing the problem on?

Other

If other, please specify.

Workers SSR

What operating system are you using?

/

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@snowystinger
Copy link
Member

Thanks for reporting that. I'm not sure what else we can do here, except not use the FinalizationRegistry if it's not available. This would bring back the previously existing memory leak for those environments. Given that this is a serverless environment though, I guess the memory leak wouldn't matter because it's all new for every request and the leak would just be thrown away.

For now, you can patch-package so it doesn't break you.

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 a pull request may close this issue.

2 participants