Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post RN 44.2 Update UnableToResolve 'ActivityIndicator' #14302

Closed
emrehayirci opened this issue Jun 2, 2017 · 5 comments
Closed

Post RN 44.2 Update UnableToResolve 'ActivityIndicator' #14302

emrehayirci opened this issue Jun 2, 2017 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@emrehayirci
Copy link

emrehayirci commented Jun 2, 2017

Hello
I cloned one of my project and updated it's version. After update i got this error:

error: bundling: UnableToResolveError: Unable to resolve module `ActivityIndicator` 
from `C:\Users\02483901\Desktop\RN Start Over\Peerket_Mobile\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: 
Module does not exist in the module map or in these directories:  
C:\Users\02483901\Desktop\RN Start Over\Peerket_Mobile\node_modulesThis might be related 
to https://github.com/facebook/react-native/issues/4968To 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 packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.    
at ResolutionRequest._resolveNodeDependency (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:394:11)    
at tryResolveSync (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:136:20)    
at tryResolveSync (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:66:12)    
at ResolutionRequest.resolveDependency (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:134:22)    
at dependencyNames.map.name (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:145:59)    
at Array.map (native)    
at ResolutionRequest.resolveModuleDependencies (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:145:42)    
at Promise.resolve.then (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:169:21)    
at <anonymous>    
at process._tickCallback (internal/process/next_tick.js:169:7)Bundling `index.android.js`  22.0% (15/32), failed.
Make sure your issue reproduces on master. Your issue may already have been fixed!
If your issue is present in master and in the stable release, try to reproduce your bug on https://snack.expo.io/
If you can't reproduce the bug on Snack, provide a sample project. 
At the very least, provide an example of your code.

I applied all the methods that listed above, even updated my node version. Still i got this error.
By the way i am on Windows so i am not using watchman.
Later i gave it up started a new project. I only import packages that i used on this project. Even the code is just hello world code of RN i got the same error.

My Package.Json:

{
	"name": **my project name**,
	"version": "0.0.1",
	"private": true,
	"scripts": {
		"start": "node node_modules/react-native/local-cli/cli.js start",
		"test": "jest"
	},
	"dependencies": {
		"node-gyp": "^3.6.1",
		"react": "16.0.0-alpha.6",
		"react-native": "0.44.2",
		"react-native-accordion": "^1.0.1",
		"react-native-calendar-picker": "^5.7.0",
		"react-native-fab": "^1.0.1",
		"react-native-fetch-blob": "^0.10.5",
		"react-native-image-picker": "^0.26.3",
		"react-native-image-slider": "^1.1.5",
		"react-native-scrollable-tab-view": "^0.6.6",
		"react-native-snap-carousel": "^2.1.4",
		"react-native-swiper": "^1.5.4",
		"react-native-tab-navigator": "^0.3.3",
		"react-native-vector-icons": "^4.2.0",
		"react-navigation": "^1.0.0-beta.11",
		"realm": "^1.3.1"
	},
	"devDependencies": {
		"babel-jest": "20.0.3",
		"babel-preset-react-native": "1.9.2",
		"jest": "20.0.4",
		"react-test-renderer": "16.0.0-alpha.6"
	},
	"jest": {
		"preset": "react-native"
	}
}

For the reproduction: You can init a RN project and then change it's project json. Then do and do npm install and you just received an error!

What am i doing wrong? How can solve this ? What is going on?

@emrehayirci emrehayirci changed the title Post RN 44.2 Update after making Npm İnstall Post RN 44.2 Update UnableToResolve 'ActivityIndicator' Jun 2, 2017
@hramos
Copy link
Contributor

hramos commented Jun 2, 2017

Hey, thanks for reporting this issue!

It looks like your description is missing some necessary information. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!

@hramos hramos closed this as completed Jun 2, 2017
@emrehayirci
Copy link
Author

@hramos thanks for the heads up . I was able to solve this by myself. Let me explain this issue detailed and ask the questions inside my head:

Everything started when i wanted to clone my project from github and update my project to RN - 44.2 .
After various attempts on clonenig, updating, re-installing i got error above and then i decided to start a clean project in 44.2 , add dependent packages , and paste js code.

I started a new project with react-native init and then imported package called react-native-calendar-picker I got the following error same as above :

You can also reproduce this error with just react native init and npm install --save react-native-calendar-picker

error: bundling: UnableToResolveError: Unable to resolve module `ActivityIndicator` 
from `**my project path**\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: 
Module does not exist in the module map or in these directories:  
`**my project path**\node_modulesThis might be related 
to https://github.com/facebook/react-native/issues/4968To 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 packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.    
at ResolutionRequest._resolveNodeDependency (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:394:11)    
at tryResolveSync (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:136:20)    
at tryResolveSync (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:66:12)    
at ResolutionRequest.resolveDependency (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:134:22)    
at dependencyNames.map.name (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:145:59)    
at Array.map (native)    
at ResolutionRequest.resolveModuleDependencies (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:145:42)    
at Promise.resolve.then (**my project root**/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:169:21)    
at <anonymous>    
at process._tickCallback (internal/process/next_tick.js:169:7)Bundling `index.android.js`  22.0% (15/32), failed.

I only have dependet one extra package other then react and react native. And my js code was hello world code of RN itself.

After reproducing this error i looked at the package react-native-calendar-picker 's project.json file . I saw that react-native 42.3 was in dependeny field. It should be at peer-dependencies or
dev-dependencies in project.json .
It turns out that if a dependent package includes react-native in its' node_module folder this error occours. Things got broken at react-native-implementation.js . So two react native accourance by making that mistake explained here crashes whole react-native importings : https://nodejs.org/en/blog/npm/peer-dependencies/

Fixing dependency in clone also did not solved my error. I was able to solve error with starting a new project, importing packages one by one (not bulk loading with editing project.json and making npm install. Npm installing gave me the same error again) and then pasting my js code.

I would like to ask:
Is there a difference between bulk loading multiple dependencies with npm install between installing each dependency one by one in the aspect of peer dependency resolution ?

I luckily solved this but what is the real explanation here? What is the problem? Lots of question marks in my head. I believe that it is certain

I also believe that this issue is related with #14209

@cogmeta
Copy link

cogmeta commented Jun 11, 2017

We ran into same exact trouble after installing react-native-calendar-picker.

@emrehayirci
Copy link
Author

@cogmeta could you please install it directly from github repository not from npm.

@peacechen
Copy link

peacechen commented Jun 12, 2017

Thanks @emrehayirci, this was exactly the problem I encountered. Pointing to the latest version of react-native-calendar-picker (the Github repo) works because the React dependency has been moved to devDependencies. Stephy should publish the latest version on npm to avoid this common error.

PS: After pointing to the latest version, delete node_modules and re-install to get rid of the duplicate nested version of React.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants