Error after upgrading from React Native 0.45.1 to 0.46.4 - react-native

error: bundling failed: "Unable to resolve module `ReactNative` from `C:\\AnchorDev\\Anchor\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: `watchman watch-del-all`.\n 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n 3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`."
This is the error that I received after upgrading React Native from 0.45.1 to 0.46.4. I ran npm i but I still get the error. How do I resolve it?

Try deleting node_modules folder and install packages again with npm install

Related

Module `react-navigation-tabs` does not exist in the Haste module map

I try to create a tab navigation in react native. But when I want to import import { createBottomTabNavigator } from 'react-navigation-tabs';. I have the following error : bundling failed: Error: Unable to resolve module `react-navigation-tabs` from `/Users/nicolasthibault/Desktop/RunApplication/Runenger/Views/NavigationReact.js`: Module `react-navigation-tabs` does not exist in the Haste module map.
I tried many commands that I found to similar topic but any of them works in my situation.
For example, I tried these ones but it doesn't solve my problem.
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
Thanks for your help.
Install react-navigation-tabs:
yarn add react-navigation-tabs
Or
npm install react-navigation-tabs
Then run metro:
react-native start --reset-cache
Also make sure you've followed the instructions here: https://reactnavigation.org/docs/en/getting-started.html
1) Install 'react-navigation-tabs' using either npm or yarn
2) Build your project using npm start --reset-cache, If you are using expo use expo r -c
It'll work.

Unable to resolve module `#expo/vector-icons/fonts/Ionicons.ttf`

absolute beginner in react native here,
I'm trying to follow the react native tutorial in here, and I get the following error when trying to run the second app version (v0.1.1).
I'm using expo to create the project, as suggested in the tutorial.
I tried deleting node_modules and re-installing the dependencies, I tried doing the steps suggested in the error.
I googled the error and tried the steps suggested here (removing babel-preset-expo from dependencies and re-installing them), but nothing helped.
Is this a version issue? I see that Ionicons.ttf does exist under node_modules\#expo\vector-icons, but in a different path, #expo/vector-icons/website/src/fonts
The development server returned response error code: 500
URL: http://192.168.1.102:19001/node_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false&assetPlugin=%2FUsers%2Fyossiv%2Fgit%2Fqr-scanner%2Fnode_modules%2Fexpo%2Ftools%2FhashAssetFiles.js
Body: {"originModulePath":"/Users/yossiv/git/qr-scanner/App.js",
"targetModuleName":"#expo/vector-icons/fonts/Ionicons.ttf",
"message":"Unable to resolve module `#expo/vector-icons/fonts/Ionicons.ttf` from `/Users/yossiv/git/qr-scanner/App.js`: Module `#expo/vector-icons/fonts/Ionicons.ttf` does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.","errors":[{"description":"Unable to resolve module `#expo/vector-icons/fonts/Ionicons.ttf` from `/Users/yossiv/git/qr-scanner/App.js`: Module `#expo/vector-icons/fonts/Ionicons.ttf` does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`."}],"name":"Error","stack":"Error: Unable to resolve module `#expo/vector-icons/fonts/Ionicons.ttf` from `/Users/yossiv/git/qr-scanner/App.js`: Module `#expo/vector-icons/fonts/Ionicons.ttf` does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
at ModuleResolver.resolveDependency (/Users/yossiv/git/qr-scanner/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
at ResolutionRequest.resolveDependency (/Users/yossiv/git/qr-scanner/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
at DependencyGraph.resolveDependency (/Users/yossiv/git/qr-scanner/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
at Object.resolve (/Users/yossiv/git/qr-scanner/node_modules/metro/src/lib/transformHelpers.js:180:25)
at dependencies.map.result (/Users/yossiv/git/qr-scanner/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
at Array.map (<anonymous>)
at resolveDependencies (/Users/yossiv/git/qr-scanner/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
at /Users/yossiv/git/qr-scanner/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
at Generator.next (<anonymous>)
at step (/Users/yossiv/git/qr-scanner/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)"} processBundleResult
BundleDownloader.java:300 access$200
BundleDownloader.java:37 onChunkComplete
BundleDownloader.java:224 emitChunk
MultipartStreamReader.java:76 readAllParts
MultipartStreamReader.java:154 processMultipartResponse
BundleDownloader.java:208 access$100
BundleDownloader.java:37 onResponse
BundleDownloader.java:169 c
RealCall.java:135 run
NamedRunnable.java:32 runWorker
ThreadPoolExecutor.java:1133 run
ThreadPoolExecutor.java:607 run
Thread.java:761
you have to do npm install --save #expo/vector-icons
and change imports path #expo/vector-icons/fonts/... by the new route #expo/vector-icons/website/src/fonts/... in the files you call that font.
example
import IoniconsFont from '#expo/vector-icons/fonts/Ionicons.ttf';
by
import IoniconsFont from '#expo/vector-icons/website/src/fonts/Ionicons.ttf';
A conflict may occur due to module installation using the same icon.
npm install --save #expo/vector-icons

React native development server returned response error code :500

The application is installed in the emulator. But it is not starting. Emulator points me out this error.
At the same time server gives following errors.
error: bundling failed: TypeError: Cannot read property
'throwIfClosureRequired' of undefined (While processing preset:
"C:\Users\sajithk\UTransP\node_modules\babel-preset-react-native\index.js")
at _default (C:\Users\sajithk\UTransP\node_modules\babel-preset-react-native\node_modules\#babel\plugin-transform-block-scoping\lib\index.js:19:36)
at Function.memoisePluginContainer (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:113:13)
at Function.normalisePlugin (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:146:32)
at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30
at Array.map ()
at Function.normalisePlugins (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
at OptionManager.mergeOptions (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14
at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
This is the first time i ran the application in the emulator after creating the project.
I had the same problem and in my case I solved it by changing the babel-preset-react-native version from 5.0.0 to 4.0.0
And follow the instructions:
Clear watchman watches: watchman watch-del-all.
Delete the node_modules folder: rm -rf node_modules && npm install.
Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
What's your babel-preset-react-native version?
Try this command:
npm install --save babel-preset-react-native#2.1.0
in console: npx react-native start
npm install react-navigation --save
I used the above fixed my issue, if anyone have same issue, just try.
if anyone know why this command can fix the issue, I am happy to learn.
Cheers

I am getting "Unable to resolve module `react

i am getting the below error.
The development server returned response error code: 500
URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
Body:
{"from":"D:\AwesomeProject\index.android.js","to":"react","message":"Unable to resolve module react from D:\\AwesomeProject\\index.android.js: Module does not exist in the module map or in these directories:\n D:\AwesomeProject\node_modules\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start --reset-cache.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]}
onResponse
DevServerHelper.java:332
execute
RealCall.java:126
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1112
run
ThreadPoolExecutor.java:587
run
Thread.java:818
{"from":":\\AwesomeProject\\index.android.js","to":"react","message":"Unable to resolve module `react`
i tried every workaround given by the log still it's not working..
Check whether the folder named react exists inside node_modules named folder or not, and if it is not there then,
stop the server and again install 'react'
npm install react --save
after the installation please restart the sever by reseting the cache
npm start --reset-cache
Then run your application
Try
npm install
hopefully this resolve
There is a problem with the node module i had to remove the node module and add then i had to downgrade the the React-Native Library and Run the command react-native start and then react-native run-android after that it worked for me.

Packager won't start after React Native Update

I updated my React-Native from 0.15.0 to 0.18.1 and it's giving the following error now. (When trying with react-native start)
Error building DependencyGraph:
Error: Naming collision detected: /Users/mymac/research/react-native/rotater/ios-templates/node_modules/fbjs/lib/warning.js collides with /Users/mymac/research/react-native/rotater/ios-templates/node_modules/react-native/node_modules/fbjs/lib/warning.js
at HasteMap._updateHasteMap (HasteMap.js:132:13)
at HasteMap.js:103:28
at tryCallOne (/Users/mymac/research/react-native/rotater/ios-templates/node_modules/promise/lib/core.js:37:12)
at /Users/mymac/research/react-native/rotater/ios-templates/node_modules/promise/lib/core.js:103:15
at flush (/Users/mymac/research/react-native/rotater/ios-templates/node_modules/asap/raw.js:50:29)
at doNTCallback0 (node.js:428:9)
at process._tickCallback (node.js:357:13)
What is the fix for this?
Try this:
rm -rf node_modules/
npm i
npm i fbjs
find . -name 'fbjs' -print
delete all but the top-level fbjs
rm -rf $TMPDIR/react-*
watchman watch-del-all
npm cache clean
I had the same issue after upgrading to version .18.1, this fixed if for me.
Have you tried deleting your node_modules folder then reinstalling using npm install?