question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

traverseDependencies throws TypeError: Cannot read property 'map' of undefined at resolveDependencies

See original GitHub issue

What is the current behavior? Running my project (an app which I work on since several months and its almost finished) via “npm run start-android” throws an exception in the metro bundler: error: bundling failed: TypeError: Cannot read property ‘map’ of undefined at resolveDependencies (C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:370:18) at C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:188:33 at Generator.next () at step (C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:298:30) at C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:309:15 at DELTA [android, dev] …/index.js ▓▓░░░░░░░░░░░░░░ 14.7% (221/612), failed.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test. I really don’t know who to achieve that with my complex project, especially when I don’t know which part is responsible.

I added a log into the file traverseDependencies.js, function resolveDependencies to log the filename that could be responsible for that. This is the output shortly before the error: FL_DEBUG: C:\Apps\MyProject\rnw\node_modules\react-native\Libraries\Inspector\ElementBox.js FL_DEBUG: C:\Apps\MyProject\rnw\node_modules\react-native\Libraries\Inspector\ElementProperties.js FL_DEBUG: C:\Apps\MyProject\rnw\node_modules\react-native\Libraries\Inspector\NetworkOverlay.js FL_DEBUG: C:\Apps\MyProject\rnw\node_modules\react-native\Libraries\Inspector\PerformanceOverlay.js FL_DEBUG: C:\Apps\MyProject\rnw\node_modules\react-native\Libraries\Animated\src\nodes\AnimatedTransform.js error: bundling failed: TypeError: Cannot read property ‘map’ of undefined at resolveDependencies (C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:370:18) at C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:188:33 at Generator.next () at step (C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:298:30) at C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:309:15 at DELTA [android, dev] …/index.js ▓▓░░░░░░░░░░░░░░ 14.7% (221/612), failed.

So I guess maybe C:\Apps\MyProject\rnw\node_modules\react-native\Libraries\Animated\src\nodes\AnimatedTransform.js is responsible for the error?

I really can’t say that something I did recently in the code caused that behavior, especially not in the Animated section. I did some changes yesterday but those changes were working fine. I did nothing in the code then, just restarted my computer and started the project again, then suddenly the error appeared.

What is the expected behavior? Metro starts sucessfully and the app is shown in the emulator like always

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

Windows 10

my package_json: { “name”: “rnw_boilerplate”, “version”: “0.1.0”, “private”: true, “dependencies”: { “formik”: “^1.3.2”, “moment”: “^2.23.0”, “react”: “^16.5.1”, “react-art”: “^16.5.1”, “react-dom”: “^16.5.1”, “react-native”: “^0.57.4”, “react-native-animatable”: “^1.3.1”, “react-native-collapsible”: “^1.4.0”, “react-native-elements”: “^1.0.0-beta7”, “react-native-elevated-view”: “0.0.6”, “react-native-fast-image”: “^5.1.2”, “react-native-fbsdk”: “^0.8.0”, “react-native-localization”: “^2.0.3”, “react-native-modal-datetime-picker”: “^6.0.0”, “react-native-modal-selector”: “^1.0.1”, “react-native-orientation”: “^3.1.3”, “react-native-picker-select”: “^5.2.2”, “react-native-tab-view”: “^1.3.2”, “react-native-vector-icons”: “^6.1.0”, “react-native-web”: “^0.9.0”, “react-navigation”: “^2.18.2”, “react-navigation-backhandler”: “^1.2.0”, “react-router-dom”: “^4.3.1”, “react-router-modal”: “^1.4.2”, “yup”: “^0.26.6” }, “devDependencies”: { “babel-jest”: “^23.4.0”, “babel-preset-react-native”: “^5”, “jest”: “^23.4.1”, “react-scripts”: “1.1.5”, “react-test-renderer”: “^16.3.1” }, “scripts”: { “start”: “node node_modules/react-native/local-cli/cli.js start”, “test”: “jest”, “start-ios”: “react-native run-ios”, “start-android”: “react-native run-android”, “start-web”: “react-scripts start”, “build”: “react-scripts build”, “test-web”: “react-scripts test --env=jsdom”, “eject-web”: “react-scripts eject” } }

Please let me know if you need more information.

EDIT: More information:

React Native Environment Info: System: OS: Windows 10 CPU: (4) x64 Intel® Core™ i7-4500U CPU @ 1.80GHz Memory: 8.30 GB / 15.90 GB Binaries: Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.1.0.0 AI-173.4819257

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

34reactions
flolegecommented, Feb 10, 2019

I solved the issue by emptying the C:\Users<user>\AppData\Local\Temp folder.

0reactions
osamasaeedcommented, Feb 10, 2020

I solved the issue by deleting the C:\Users<USER>\AppData\Local\Temp\metro-cache folder

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'map' of undefined in react native ...
The solution is deleting contents of C:\Users\<User>\AppData\Local\Temp folder.
Read more >
How to Prevent the TypeError: Cannot Read Property Map ...
A guide on the root cause of 'cannot read map of undefined' as well as techniques and tools to prevent this error.
Read more >
Jammming project - Cannot read property 'map' of undefined
My app is erroring in the TrackList.js file on line 8, with “TypeError: Cannot read property 'map' of undefined”.
Read more >
Fix the "Cannot read property 'map' of undefined" Error in ...
In this post, we'll learn how to fix it. Why It's Happening. The variable you are trying to map over is undefined ....
Read more >
openpgpjs/openpgpjs - Gitter
Hello, I'm trying to use openpgpjs in my Electron app. I just include .min.js file in index.html and then got error: Uncaught Error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found