I build an expo app. How can I fix this error: ReferenceError: Property 'FinalizationRegistry' doesn't exist? It suddenly appeared without installing any new libraries. I’m only using design libraries from Gluestack. What could be causing this, and how do I resolve it?
I build an expo app. How can I fix this error: ReferenceError: Property 'FinalizationRegistry' doesn't exist? It suddenly appeared without installing any new libraries. I’m only using design libraries from Gluestack. What could be causing this, and how do I resolve it?
Share edited Mar 9 at 19:14 Abdulrahman asked Mar 9 at 19:00 AbdulrahmanAbdulrahman 259 bronze badges 2- 1 you can follow the same issue here. Basically it is coming from dependencies issues. – Akash Gautam Commented Mar 9 at 19:44
- @Abdulrahman You should add what you did to solve the issue as an answer here and self-accept it rather than just mentioning it in a comment. – NotTheDr01ds Commented Mar 9 at 23:14
3 Answers
Reset to default 1it seems everyone is facing this issue this week due to new updates in gluestack, I just added in package.json file the following:
"overrides": { "@react-aria/utils": "3.27.0" },
gluestack-ui
developer here, the issue is fixed now.
- remove any
overrides
orresolutions
from yourpackage.json
file for@react-aria/utils
. - You can delete the lock file, delete your
node_modules
. - Run the install command again.
Basically the developers of @react-aria/utils
released a patch update i.e. 3.28.1
.
We verified this and is working now.
Possible Causes & Fixes
1. Ensure You’re Using Hermes (Recommended)
Expo supports Hermes, which includes FinalizationRegistry
. To enable it:
- Open your
expo
project'sapp.json
orapp.config.js
. - Add or modify the
jsEngine
field underexpo
:{ "expo": { "jsEngine": "hermes" } }
- Rebuild your project:
expo prebuild expo run:android
2. Check Node.js & Expo SDK Compatibility
If your Expo SDK version is outdated, it might not support FinalizationRegistry
. Check your Expo version:
expo --version
Then, upgrade Expo if necessary:
npm install -g expo-cli
expo upgrade
3. Ensure You’re Using a Compatible React Native Version
FinalizationRegistry
was introduced in Node.js 14+ and React Native 0.66+. If you're using an older version of React Native, update it:
npm install react-native@latest
4. Check Your Metro Bundler
Metro might be bundling an outdated JavaScript runtime. Clear its cache and restart:
expo start -c
**5. Since you're using Gluestack UI, ensure it's up to date:
npm update gluestack-ui
If the issue persists, try running:
expo doctor
to check for inconsistencies.