react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Packager] Cannot read property 'root' of null

Open ilansas opened this issue 11 years ago • 62 comments

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)

ilansas avatar Jul 06 '15 09:07 ilansas

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.

chirag04 avatar Jul 06 '15 15:07 chirag04

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

grabbou avatar Jul 06 '15 15:07 grabbou

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 avatar Jul 06 '15 15:07 mrspeaker

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

mrspeaker avatar Jul 06 '15 16:07 mrspeaker

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 avatar Jul 07 '15 08:07 ilansas

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

chirag04 avatar Jul 07 '15 14:07 chirag04

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 avatar Jul 08 '15 17:07 jaygarcia

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

jaygarcia avatar Jul 08 '15 17:07 jaygarcia

@jaygarcia update your watchman

chirag04 avatar Jul 08 '15 17:07 chirag04

@chirag04 , that fixed it.

Any way we could get a warning setup somehow?

jaygarcia avatar Jul 08 '15 18:07 jaygarcia

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

hokster7 avatar Jul 17 '15 10:07 hokster7

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.

malkomalko avatar Jul 17 '15 12:07 malkomalko

@brentvatne seems like the solution is to upgrade watchman

browniefed avatar Jul 20 '15 20:07 browniefed

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

brentvatne avatar Jul 20 '15 22:07 brentvatne

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

olivierlesnicki avatar Jul 26 '15 16:07 olivierlesnicki

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

xuwenmin avatar Jul 30 '15 07:07 xuwenmin

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.

ammbo avatar Aug 03 '15 19:08 ammbo

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.

ryanmcdermott avatar Aug 12 '15 20:08 ryanmcdermott

@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"

browniefed avatar Aug 12 '15 22:08 browniefed

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

ryanmcdermott avatar Aug 13 '15 02:08 ryanmcdermott