最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ReferenceError: Property 'FinalizationRegistry' doesn't exist [Component Stack] - Stack Ove

programmeradmin2浏览0评论

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
Add a comment  | 

3 Answers 3

Reset to default 1

it 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 or resolutions from your package.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:

  1. Open your expo project's app.json or app.config.js.
  2. Add or modify the jsEngine field under expo:
    {
      "expo": {
        "jsEngine": "hermes"
      }
    }
    
  3. 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.

发布评论

评论列表(0)

  1. 暂无评论