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

[Packager] Cannot read property 'root' of null #1875

Closed
ilansas opened this issue Jul 6, 2015 · 62 comments

Comments

Projects
None yet
@ilansas
Copy link

commented Jul 6, 2015

Hello,
I tried to update react-native or reinstalled it but no positive effect. This happens right after launching the app.
Does anyone has more info on this ? Thanks

TypeError: Cannot read property 'root' of null
    at /Users/isasportas/Projects/canalplus/iOS/RemoteX1/node_modules/react-native/packager/react-packager/src/DependencyResolver/crawlers/index.js:16:84
    at tryCallOne (/Users/isasportas/Projects/canalplus/iOS/RemoteX1/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/isasportas/Projects/canalplus/iOS/RemoteX1/node_modules/react-native/node_modules/promise/lib/core.js:103:15
    at flush (/Users/isasportas/Projects/canalplus/iOS/RemoteX1/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at process._tickCallback (node.js:355:11)

@ide ide added the packager label Jul 6, 2015

@chirag04

This comment has been minimized.

Copy link
Collaborator

commented Jul 6, 2015

I'm getting the exact same error. I think i solved this one by updating flow and watchman. Now i have issues related to settings modules in react-native. I reverted back to 0.6 for now.

@grabbou

This comment has been minimized.

Copy link
Collaborator

commented Jul 6, 2015

Used to be in React 0.5. No issues on React 0.6

@mrspeaker

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2015

I'm also seeing this on master ("react packager has encountered an internal error" in the app and "Cannot read property 'root' of null" in the packager). I first got this after pulling master last Thursday afternoon. I had to revert to back to 951b5f9 (26 June) so I could keep working.

@mrspeaker

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2015

Ah, good tip @chirag04: updating watchman (brew update and brew upgrade watchman) fixed this issue for me.

@ilansas

This comment has been minimized.

Copy link
Author

commented Jul 7, 2015

Yep upgrading watchman fixed the issue. Thanks. But it would have been too simple to make things work haha, now I'm getting this :

Error: undefined is not an object (evaluating 'RCTSettingsManager.settings')

So the same issue as @chirag04 ... I'm on 0.6 by the way

@ilansas ilansas closed this Jul 7, 2015

@ilansas ilansas reopened this Jul 7, 2015

@chirag04

This comment has been minimized.

Copy link
Collaborator

commented Jul 7, 2015

@ilansas I have the exact same error. Not sure what is the fix here.

@brentvatne brentvatne changed the title Cannot read property 'root' of null [Packager] Cannot read property 'root' of null Jul 7, 2015

@jaygarcia

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2015

This issue is exhibited in master at the current time. I performed a git pull origin master, then npm i.

Looking for JS files in
   /www/ios/react-native.fresh 


React packager ready.

[1:11:43 PM] <START> fs crawl
TypeError: Cannot read property 'root' of null
    at /www/ios/react-native.fresh/packager/react-packager/src/DependencyResolver/crawlers/index.js:16:84
    at tryCallOne (/www/ios/react-native.fresh/node_modules/promise/lib/core.js:37:12)
    at /www/ios/react-native.fresh/node_modules/promise/lib/core.js:103:15
    at flush (/www/ios/react-native.fresh/node_modules/promise/node_modules/asap/raw.js:50:29)
    at process._tickCallback (node.js:355:11)
[1:11:44 PM] <START> request:/Examples/UIExplorer/UIExplorerApp.ios.includeRequire.runModule.bundle?dev=true

@jaygarcia

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2015

Removing node_modules and doing an npm doesn't fix the issue.

@chirag04

This comment has been minimized.

Copy link
Collaborator

commented Jul 8, 2015

@jaygarcia update your watchman

@jaygarcia

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2015

@chirag04 , that fixed it.

Any way we could get a warning setup somehow?

@fatuhoku

This comment has been minimized.

Copy link

commented Jul 17, 2015

+1 go this error as well. Resolved it by upgrading watchman as above.

@malkomalko

This comment has been minimized.

Copy link

commented Jul 17, 2015

As mentioned previously it'd be nice to know that the watchman version is too old for the specific version of react-native. As an external dependency outside of npm, it'd be great to be able to check that version to show custom error messages to guide the user.

@browniefed

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2015

@brentvatne seems like the solution is to upgrade watchman

@brentvatne

This comment has been minimized.

Copy link
Collaborator

commented Jul 20, 2015

@malkomalko - good point, can you create an issue or PR for that? Closing this one as upgrading solves it!

@brentvatne brentvatne closed this Jul 20, 2015

@olivierlesnicki

This comment has been minimized.

Copy link

commented Jul 26, 2015

same issue, a warning would have been welcomed (i guess pr hasn't been opened yet)

@xuwenmin

This comment has been minimized.

Copy link

commented Jul 30, 2015

i have some issue, but brew upgrade watchman,it's ok.

@ammbo

This comment has been minimized.

Copy link

commented Aug 3, 2015

In addition to upgrading Watchman, I also had to quit terminal in order to clear the error. Killing the terminal window that Xcode opened should be sufficient.

@ryanmcdermott

This comment has been minimized.

Copy link

commented Aug 12, 2015

Chiming in here, I had to upgrade watchman as well. That fixed it for me! It would be nice if the docs mentioned updating brew prior to installing the necessary packages.

@browniefed

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2015

@ryanmcdermott "We recommend periodically running brew update && brew upgrade to keep your programs up-to-date." it does, but I guess it doesn't say "do that first"

@ryanmcdermott

This comment has been minimized.

Copy link

commented Aug 13, 2015

@browniefed I should always be in the habit of doing that regardless of if I read directions or not!

@xcatliu

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2015

Same error

@lifuzu

This comment has been minimized.

Copy link

commented Aug 26, 2015

@xcatliu run the following commands: "brew update && brew upgrade watchman"

@ptmt

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2015

Same error after updating to 0.10.0.

$ brew update
Already up-to-date.
$ brew upgrade watchman
Error: watchman HEAD already installed

Restarted, cache flushed. Temporary change the line to
return fileWatcher.getWatchers().then(([watcher]) => return true)

@gbezyuk

This comment has been minimized.

Copy link

commented Aug 29, 2015

Getting exactly the same error on a fresh installation.

@andrearota

This comment has been minimized.

Copy link

commented Sep 17, 2015

+1 for @cmpis solution

@weblancaster

This comment has been minimized.

Copy link

commented Sep 17, 2015

I had same error on fresh start.. after brew update and brew upgrade watchman and restart the terminal.. things started to work..

Would be great if we could have this on the documentation.

So remember to close/open your terminal

@appleboy

This comment has been minimized.

Copy link

commented Sep 18, 2015

Please try the following steps, it is working for me.

$ brew unlink watchman
$ brew install watchman

screen shot 2015-09-18 at 4 46 38 pm

@3nit

This comment has been minimized.

Copy link

commented Sep 19, 2015

I'm having the same issue on a fresh install on El Capitan (latest beta)

Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Downloading https://homebrew.bintray.com/bottles/watchman-3.7.0.el_capitan.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/watchman-3.7.0.el_capitan.bottle.tar.gz
==> Pouring watchman-3.7.0.el_capitan.bottle.tar.gz

Anyone got this running on El Capitan? I'm using Xcode 7 (final, not the beta)

@3nit 3nit referenced this issue Sep 20, 2015

Closed

Xcode 7 support #2883

@3nit

This comment has been minimized.

Copy link

commented Sep 20, 2015

I've found a solution. My watchman was installed via MacPorts and not via brew.

You can verify it with watchman -v. If it's still 3.1.0 after updating brew it means it's managed by macports.

To get it working on El Capitan, remove macports and install it via brew
sudo rm -rf /opt/local \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/LaunchDaemons/org.macports.* \ /Library/Receipts/DarwinPorts*.pkg \ /Library/Receipts/MacPorts*.pkg \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0 \ ~/.macports

You might also brew uninstall pcre && brew install pcre if you're getting errors about get-sockname.

@ictliujie

This comment has been minimized.

Copy link

commented Sep 21, 2015

@ohadpartuck it worked, thx a lot

@3nit

This comment has been minimized.

Copy link

commented Sep 21, 2015

I guess I'm the only one using macports here :-) might as well get rid of that option in the docs and only recommend brew

@mschipperheyn

This comment has been minimized.

Copy link

commented Sep 28, 2015

I found I had to actually uninstall watchman and reinstall it to get the correct El Capitan version. After that it worked

@GameReplays

This comment has been minimized.

Copy link

commented Oct 2, 2015

I am still having this issue. Entirely removed watchman, and reinstalled at version 3.8.0.

OSX Yosemite, XCode 7 Beta 5, Node 4.1.1

@nick

This comment has been minimized.

Copy link

commented Oct 4, 2015

@GameReplays I had the same issue and ended up checking out a fresh copy of react-native which seemed to resolve the issue (after re-installing watchman etc)

@cakiem8x

This comment has been minimized.

Copy link

commented Oct 6, 2015

I had a issue " ERROR watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty" on El Capitan 10.11.1 beta. I'm trying fix it but not work :(

@tylermadison

This comment has been minimized.

Copy link

commented Oct 8, 2015

@appleboy Was having same issue El Capitan 10.11 Beta (15A279b) fixed by:
brew uninstall watchman
brew install watchman

@kalehv

This comment has been minimized.

Copy link

commented Oct 15, 2015

As others have said, removing and installing watchman worked for me

@jackqqxu

This comment has been minimized.

Copy link

commented Oct 17, 2015

Had the same problems here - @cmpis's fix worked for me. It takes me a long time to fix it.
Try:
git fetch origin
git reset --hard origin/master
brew update
brew uninstall watchman
brew unlink watchman
brew install watchman --HEAD

@norfish

This comment has been minimized.

Copy link

commented Oct 31, 2015

$ brew uninstall watchman
$ brew  install watchman --HEAD

works for me. When I use brew upgrade watchman,only get Error: watchman-HEAD already installed.

@nsisodiya

This comment has been minimized.

Copy link

commented Nov 15, 2015

I am using El Capitan version and stuck at same error, tried all possible permutation and combination.

@huang47

This comment has been minimized.

Copy link

commented Dec 1, 2015

same here, El Capitan and running into below errors

Error building DependencyGraph:
 TypeError: Cannot read property 'root' of undefined
    at index.js:16:84
    at tryCallOne (/Users/huang47/Documents/projects/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/huang47/Documents/projects/react-native/node_modules/promise/lib/core.js:103:15
    at flush (/Users/huang47/Documents/projects/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:417:9)
    at process._tickCallback (node.js:346:13)
@bobmoff

This comment has been minimized.

Copy link

commented Dec 14, 2015

Also got

TypeError: Cannot read property 'root' of undefined

but solved it using @norfish solution. thx!

@raheelshah31

This comment has been minimized.

Copy link

commented Dec 16, 2015

Updating watchman works!!! Thanks

@webrules

This comment has been minimized.

Copy link

commented Feb 21, 2016

I should have googled first. Wasted a few hours to update various Homebrew packages. Simply "brew upgrade watchman" didn't work for me. But the one mentioned by @norfish worked. Thanks a lot!

@zackgq2009

This comment has been minimized.

Copy link

commented Mar 28, 2016

brew upgrade watchman, this error is gone!

@norfish

This comment has been minimized.

Copy link

commented May 14, 2016

brew update && brew unlink watchman && brew install watchman -HEAD

this works for me

@MarkStray

This comment has been minimized.

Copy link

commented Aug 15, 2016

$ brew update
$ brew upgrade watchman

it's work for me

@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.