traverseDependencies throws TypeError: Cannot read property 'map' of undefined at resolveDependencies
See original GitHub issueWhat 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:
- Created 5 years ago
- Comments:11
Top GitHub Comments
I solved the issue by emptying the C:\Users<user>\AppData\Local\Temp folder.
I solved the issue by deleting the C:\Users<USER>\AppData\Local\Temp\metro-cache folder