3

I tried to run my application on the emulator, the build is successfully done but when the app starts to bundle on about 26% this error pops up to the cmd:

[Mon Nov 08 2021 13:00:11.720] BUNDLE ./index.js
error: TypeError: Cannot read properties of undefined (reading 'reduce')
 at resolveDependencies (C:\Users\iarch\Desktop\Directik App\mobile-v2-new\node_modules\metro\src\DeltaBundler\traverseDependencies.js:586:33)
 at C:\Users\iarch\Desktop\Directik App\mobile-v2-new\node_modules\metro\src\DeltaBundler\traverseDependencies.js:275:33
 at Generator.next (<anonymous>)
 at asyncGeneratorStep (C:\Users\iarch\Desktop\Directik App\mobile-v2-new\node_modules\metro\src\DeltaBundler\traverseDependencies.js:87:24)
 at _next (C:\Users\iarch\Desktop\Directik App\mobile-v2-new\node_modules\metro\src\DeltaBundler\traverseDependencies.js:107:9)
 at processTicksAndRejections (node:internal/process/task_queues:96:5)

and on the emulator splash screen shows up and then red screen appears:

enter image description here

i tried to solve with this versions of node:

17.0.1
16.13.0
16.10.0
14.18.1

and for every single one, I delete node_modules folder and then change my node version with nvs and afterward I run npm install but same thig happened. how can I solve this?

asked Jul 6, 2021 at 6:42

5 Answers 5

6
+50

for me this was due to the way I run project on emulator. if you just run npm run android and wait for bundler to show up on another terminal,try this: open up a terminal and run npm start on it wait for the react logo to show up. then open another terminal and npm run android. I don't know why but this worked in my case.

answered Nov 8, 2021 at 13:36
Sign up to request clarification or add additional context in comments.

Comments

1

It's Javascript code error very often found when we are connecting API's and the server is damaged/down so... Useful link is below I found help in Mozila Docx 6.6.1. 500 Internal Server Error The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. Reference Document

https://httpwg.org/specs/rfc7231.html#status.500

answered Nov 8, 2021 at 9:43

Comments

0

You may try restarting the bundler without caches:

npm start -- --reset-cache

If this doesn't work, you may need to clear everything and restart the server from there:

watchman watch-del-all && 
rm -rf $TMPDIR/react-native-packager-cache-* &&
rm -rf $TMPDIR/metro-bundler-cache-* && 
rm -rf node_modules/ 
&& npm cache clean --force &&
npm install && 
npm start -- --reset-cache

Taken from: How to clear react-native cache?


If nothing else works, are you sure you don't have an error in your code?

answered Nov 8, 2021 at 9:53

Comments

0

make sure you have all the required packages installed in your application. I was also getting the same error due to missing package. I installed that package and the error got resolved.

answered Jul 4, 2024 at 10:37

Comments

-2

You first nedd to install react native community by given command

npm i @react-native-community/cli

Then you need you install react-timer-mixin as they help us to develop a faster responced server

npm install react-timer-mixin

This might solve your issue

answered Nov 8, 2021 at 9:49

2 Comments

How is react-timer-mixin useful in this situation
If you include TimerMixin, then you can replace your calls to setTimeout(fn, 500) with setTimeout(fn, 500) and everything will be properly cleaned up for you.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.