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

npm start fails with "Watcher took too long to load" #20

Closed
mfikes opened this issue Jan 31, 2015 · 8 comments
Closed

npm start fails with "Watcher took too long to load" #20

mfikes opened this issue Jan 31, 2015 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mfikes
Copy link

mfikes commented Jan 31, 2015

When I run npm start, it fails indicating a timeout. (This is on a circa-2011 Mac laptop.)

Mike-Fikess-MacBook-Pro:react-native mfikes$ npm start

> react-native@0.0.1 start /Users/mfikes/Documents/Projects/react-native
> ./packager/packager.sh


 ===============================================================
 |  Running packager on port 8081.       
 |  Keep this packager running while developing on any JS         
 |  projects. Feel free to close this tab and run your own      
 |  packager instance if you prefer.                              
 |                                                              
 |     https://github.com/facebook/react-native                 
 |                                                              
 ===============================================================


React packager ready.

[Error: Watcher took too long to load.]
Error: Watcher took too long to load.
    at null._onTimeout (/Users/mfikes/Documents/Projects/react-native/packager/react-packager/src/FileWatcher/index.js:37:16)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

  >>> ERROR: could not create packager - please shut down any existing instances that are already running.

I've rebooted just to be sure nothing else is running.

To rule out a race, I've increased the MAX_WAIT_TIME on line 21 of react-native/packager/react-packager/src/FileWatcher/index.js to as much as 2 minutes, but this doesn't resolve the issue.

I've installed node and watchman via brew:

Mike-Fikess-MacBook-Pro:~ mfikes$ brew list
node        pcre        watchman

and I'm running the latest version of OS X:

Mike-Fikess-MacBook-Pro:~ mfikes$ uname -a
Darwin Mike-Fikess-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64

I have all of this running successfully on another machine, so this will probably boil down to finding out what the critical difference between the two is.

@mfikes mfikes changed the title npm start fails npm start fails indicating "Watcher took too long to load" Jan 31, 2015
@mfikes mfikes changed the title npm start fails indicating "Watcher took too long to load" npm start fails with "Watcher took too long to load" Jan 31, 2015
@vjeux
Copy link
Contributor

vjeux commented Jan 31, 2015

cc @amasad

@mfikes
Copy link
Author

mfikes commented Jan 31, 2015

This was an environmental issue with a previous install of pcre on this machine and I was able to resolve it.

Here are details in case anyone else encounters it:

This was on a box that had never had Homebrew installed on it, but did have pcre installed in /usr/local and other places. When I installed Homebrew, brew doctor warned about these pcre files, and since I had previously noticed that pcre is used for React Native, I proceeded to manually remove all of the pcre files that brew doctor reported, and then proceeded with brew install node and brew install watcher.

Given that this appeared to be a watcher issue, I tried uninstalling watcher, and reinstalling it. At that point, brew had me try brew link pcre and pointed out additional existing pcre files that it was having problems with, and I addressed each of those, with the offending files/directories including

/usr/local/bin/pcre-config
/usr/local/bin/pcregrep
/usr/local/bin/pcretest
/usr/local/share/doc/pcre
/usr/local/share/man/man1/pcre*
/usr/local/share/man/man3/pcre*

After cleaning up these additional leftover files, and successfully installing watchman, I then used brew to uninstall node, pcre, and watchman and clean reinstall node and watchman.

After all of this, and in a fresh clone of react-native, things worked on this box, including running the Movies app in Xcode.

@mfikes mfikes closed this as completed Jan 31, 2015
@amasad
Copy link
Contributor

amasad commented Jan 31, 2015

I'm glad it's working now. I'm glad we put a timeout on that so it doesn't fail silently :)

@vjeux
Copy link
Contributor

vjeux commented Jan 31, 2015

Is there any way we can add a warning so that other people don't fall into the same trap?

@amasad
Copy link
Contributor

amasad commented Jan 31, 2015

I doubt it's typical problem, it's the first time I've heard of it with watchman. And a lot of people are using it through my sane module. If it comes up again, will have a deeper look.

@mfikes
Copy link
Author

mfikes commented Jan 31, 2015

FWIW, I had installed pcre binaries on this particular machine a few years ago for some esoteric thing I can't even recall the details of. I don't usually install binaries like that. That, combined with the fact that I hadn't been using Homebrew is probably a fairly rare combination. Homebrew itself tried to warn about it, so I had enough clues to go on.

The existence of the timeout is useful, IMHO. If it had somehow additionally indicated something derailing in a way that pointed a finger at pcre, that would probably have been helpful and I would have sorted it sooner, but to be honest, I didn't lose a lot of time on this and was able to sort it out pretty quickly anyway.

@frantic
Copy link
Contributor

frantic commented Feb 2, 2015

Is there any way we can add a warning so that other people don't fall into the same trap?

I think running watchman from terminal could give a clue

@brennanpayne
Copy link

I'm not sure how it all fell into place, but I ended up in the same place as @mfikes. I followed his above steps and was able to resolve the issue.

The odd part is that pcre appeared to have been installed by homebrew (it came up in brew ls). I was also able to run watchman from the command line in other scenarios and it would work, it was only not working for react-native! Anyway, uninstalling pcre and doing a fresh install of node and watchman resolved my issue. Thanks for documenting how you fixed it @mfikes!

dustturtle added a commit to dustturtle/react-native that referenced this issue Jul 6, 2016
…crash on simulator, on device I got nothing but app freezed)!

My app has an old version of JSONKit which is still using MRC. I think JSONKit is not needed if system version is available. Kicking out of JSONKit will make react native stronger.
Crash stack:
* thread facebook#11: tid = 0xbd672f, 0x000000010a10edeb imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=22 key/value pairs) + 16971 at JSONKit.m:2807, name = 'com.facebook.React.JavaScript', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x000000010a10edeb imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=22 key/value pairs) + 16971 at JSONKit.m:2807
    frame facebook#1: 0x000000010a10ef67 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=2 key/value pairs) + 17351 at JSONKit.m:2811
    frame facebook#2: 0x000000010a10ef67 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=25 key/value pairs) + 17351 at JSONKit.m:2811
    frame facebook#3: 0x000000010a10e768 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=@"3 elements") + 15304 at JSONKit.m:2778
  * frame facebook#4: 0x000000010a10a26a imobii-waiqin`-[JKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:](self=0x00007f9b831fbc80, _cmd="serializeObject:options:encodeOption:block:delegate:selector:error:", object=@"3 elements", optionFlags=0, encodeOption=10, block=0x0000000000000000, delegate=0x0000000000000000, selector=<no value available>, error=domain: class name = NSInvocation - code: 0) + 2250 at JSONKit.m:2876
    frame facebook#5: 0x000000010a109992 imobii-waiqin`+[JKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:](self=JKSerializer, _cmd="serializeObject:options:encodeOption:block:delegate:selector:error:", object=@"3 elements", optionFlags=0, encodeOption=10, block=0x0000000000000000, delegate=0x0000000000000000, selector=<no value available>, error=domain: class name = NSInvocation - code: 0) + 178 at JSONKit.m:2831
    frame facebook#6: 0x000000010a10f700 imobii-waiqin`-[NSArray(self=@"3 elements", _cmd="JSONStringWithOptions:error:", serializeOptions=0, error=domain: class name = NSInvocation - code: 0) JSONStringWithOptions:error:] + 112 at JSONKit.m:2985
    frame facebook#7: 0x000000010ac13c02 imobii-waiqin`_RCTJSONStringifyNoRetry(jsonObject=@"3 elements", error=domain: class name = NSInvocation - code: 0) + 338 at RCTUtils.m:49
    frame facebook#8: 0x000000010ac13990 imobii-waiqin`RCTJSONStringify(jsonObject=@"3 elements", error=0x0000000000000000) + 128 at RCTUtils.m:77
    frame facebook#9: 0x000000010ab5fdfa imobii-waiqin`__27-[RCTContextExecutor setUp]_block_invoke_2(.block_descriptor=<unavailable>, moduleName=@"UIManager") + 218 at RCTContextExecutor.m:363
    frame facebook#10: 0x00000001134495cc CoreFoundation`__invoking___ + 140
    frame facebook#11: 0x000000011344941e CoreFoundation`-[NSInvocation invoke] + 286
    frame facebook#12: 0x000000010db13db3 JavaScriptCore`JSC::ObjCCallbackFunctionImpl::call(JSContext*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 451
    frame facebook#13: 0x000000010db13926 JavaScriptCore`JSC::objCCallbackFunctionCallAsFunction(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 262
    frame facebook#14: 0x000000010db14bad JavaScriptCore`long long JSC::APICallbackFunction::call<JSC::ObjCCallbackFunction>(JSC::ExecState*) + 573
    frame facebook#15: 0x000000010dade340 JavaScriptCore`JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 528
    frame facebook#16: 0x000000010dae535d JavaScriptCore`llint_entry + 22900
    frame facebook#17: 0x000000010dadf7d9 JavaScriptCore`vmEntryToJavaScript + 326
    frame facebook#18: 0x000000010d9b1959 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 169
    frame facebook#19: 0x000000010d9985ad JavaScriptCore`JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 493
    frame facebook#20: 0x000000010d76cb7e JavaScriptCore`JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 62
    frame facebook#21: 0x000000010d929a55 JavaScriptCore`JSC::callGetter(JSC::ExecState*, JSC::JSValue, JSC::JSValue) + 149
    frame facebook#22: 0x000000010dad49fb JavaScriptCore`llint_slow_path_get_by_id + 2203
    frame facebook#23: 0x000000010dae22f0 JavaScriptCore`llint_entry + 10503
    frame facebook#24: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#25: 0x000000010dae52fd JavaScriptCore`llint_entry + 22804
    frame facebook#26: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#27: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#28: 0x000000010dae52fd JavaScriptCore`llint_entry + 22804
    frame facebook#29: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#30: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#31: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#32: 0x000000010dae552a JavaScriptCore`llint_entry + 23361
    frame facebook#33: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#34: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#35: 0x000000010dadf7d9 JavaScriptCore`vmEntryToJavaScript + 326
    frame facebook#36: 0x000000010d9b1959 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 169
    frame facebook#37: 0x000000010d998264 JavaScriptCore`JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*) + 10404
    frame facebook#38: 0x000000010d7a8786 JavaScriptCore`JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) + 470
    frame facebook#39: 0x000000010d9f6fb8 JavaScriptCore`JSEvaluateScript + 424
    frame facebook#40: 0x000000010ab6379e imobii-waiqin`__68-[RCTContextExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke.264(.block_descriptor=<unavailable>) + 414 at RCTContextExecutor.m:589
    frame facebook#41: 0x000000010ab63262 imobii-waiqin`__68-[RCTContextExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke(.block_descriptor=<unavailable>) + 498 at RCTContextExecutor.m:589
    frame facebook#42: 0x000000010ab63df8 imobii-waiqin`-[RCTContextExecutor executeBlockOnJavaScriptQueue:](self=0x00007f9b832f6040, _cmd="executeBlockOnJavaScriptQueue:", block=0x00007f9b80c92970) + 248 at RCTContextExecutor.m:627
    frame facebook#43: 0x000000010eb1d7a7 Foundation`__NSThreadPerformPerform + 283
    frame facebook#44: 0x0000000113486301 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame facebook#45: 0x000000011347c22c CoreFoundation`__CFRunLoopDoSources0 + 556
    frame facebook#46: 0x000000011347b6e3 CoreFoundation`__CFRunLoopRun + 867
    frame facebook#47: 0x000000011347b0f8 CoreFoundation`CFRunLoopRunSpecific + 488
    frame facebook#48: 0x000000010ab5e41b imobii-waiqin`+[RCTContextExecutor runRunLoopThread](self=RCTContextExecutor, _cmd="runRunLoopThread") + 363 at RCTContextExecutor.m:284
    frame facebook#49: 0x000000010ebc012b Foundation`__NSThread__start__ + 1198
    frame facebook#50: 0x00000001140869b1 libsystem_pthread.dylib`_pthread_body + 131
    frame facebook#51: 0x000000011408692e libsystem_pthread.dylib`_pthread_start + 168
    frame facebook#52: 0x0000000114084385 libsystem_pthread.dylib`thread_start + 13
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
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

6 participants