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

android - React Native Expo App - Missing the required default export error - Stack Overflow

programmeradmin2浏览0评论

I am developing my native expo app in web, it works completely fine but as soon as I try to test my app on android device via expo go as well as through built apk files, I get the following error:

(NOBRIDGE) WARN Route "./(app)/edit-group/[id].tsx" is missing the required default export. Ensure a React component is exported as default. [Component Stack] (NOBRIDGE) ERROR Error: Requiring unknown module "undefined". If you are sure the module exists, try restarting Metro. You may also want to run yarn or npm install. [Component Stack].

This error occurrs for each and every page component in my app, whereas I have proper default exports in all the files. Also, all the packages are properly installed.

I also tried deleting the /android directory and recreate using npx expo prebuild --clean, still the issue persists.

I am developing my native expo app in web, it works completely fine but as soon as I try to test my app on android device via expo go as well as through built apk files, I get the following error:

(NOBRIDGE) WARN Route "./(app)/edit-group/[id].tsx" is missing the required default export. Ensure a React component is exported as default. [Component Stack] (NOBRIDGE) ERROR Error: Requiring unknown module "undefined". If you are sure the module exists, try restarting Metro. You may also want to run yarn or npm install. [Component Stack].

This error occurrs for each and every page component in my app, whereas I have proper default exports in all the files. Also, all the packages are properly installed.

I also tried deleting the /android directory and recreate using npx expo prebuild --clean, still the issue persists.

Share Improve this question asked Mar 11 at 9:52 Vinayak SurshettyVinayak Surshetty 111 silver badge2 bronze badges 1
  • Did you manage to fix this? I'm getting the same issue. Thank you in advance – Javier Guzmán Commented Apr 7 at 4:16
Add a comment  | 

1 Answer 1

Reset to default 0

I upgraded react-native to the latest version (0.78.0) and it's fixed.

Note: But also it's required to update React 19

发布评论

评论列表(0)

  1. 暂无评论