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

Slow Merging Inference #1570

Closed
3miliano opened this issue Mar 23, 2016 · 11 comments
Closed

Slow Merging Inference #1570

3miliano opened this issue Mar 23, 2016 · 11 comments

Comments

@3miliano
Copy link

It seems that my code is doing somethings weird for Flow, it used to work fine, but all the sudden it takes a long time (more than 10 minutes) to do the merging inference pass.

Launching Flow server for /Users/Emiliano/Source/parser
Spawned flow server (child pid=77755)
Logs will go to /private/tmp/flow/zSUserszSEmilianozSSourcezSparser.log
flow is still initializing; this can take some time. [merging inference] \

I could not find a way to verbose Flow, or to trace its execution to see what is going on. Does such option exists? How can I diagnose or see what it is doing that is taking so long?

@arypurnomoz
Copy link

I also got this error, turns out i have some module that depends recursively:

  • module A requires module B
  • module B requires module A

Fixed it by stopping the module to require each other

@bsr203
Copy link

bsr203 commented May 26, 2016

@arypurnomoz how did you trace which module had cyclic dependency?

I was using flow well till the latest release, and it never come out of flow is still initializing untill my system frozen few times :-) mac OSX 10.9.5.

@arypurnomoz
Copy link

arypurnomoz commented May 27, 2016

i just removed all require, started flow, then i added the required module one by one to see which one froze my flow server.

@bsr203
Copy link

bsr203 commented May 27, 2016

@arypurnomoz thanks. My issue was tons of dependencies in node_modeules. I excluded them, and added interface def for some of them I use.

@AndrewRayCode
Copy link

AndrewRayCode commented Jul 21, 2016

@bsr203 I made a tool specifically to help with this :)

https:/AndrewRayCode/webpack-cyclic-dependency-checker

@MoOx
Copy link

MoOx commented Mar 10, 2017

In my case I got a weird code a bit like this:

const newThing = [
  ...something,
  ...Object.keys(obj).map((key) => return func(/* return an object */))
]

Had to change to

const stuff = Object.keys(obj).map((key) => return func(/* return an object */))
const newThing = [
  ...something,
  ...stuff
]

to avoid the 5min stuck on "merging inference".

Was not fun to debug but I did some dichotomie using flow [ignore] option to disable files and find the culprit. Then I disabled code in the file that was slowing down...

Also I was doing "killall flow && flow" to be sure to have a new instance cause otherwise, I was not always able to get the slow "merging inference" step.

@insidewhy
Copy link

I've had simple changes make flows inference process skyrocket a few times now. The lack of tools to diagnose this makes flow almost intolerable for me to use. Always worried I'll make it go crazy and be stuck in a lengthy process of trial and error.

@cptroot
Copy link

cptroot commented Nov 7, 2017

Has there been any progress on making Flow not throw it's hands up in anger when it runs into a circular dependency? I have two files that import each other to use constants, but Flow takes an eternity on the "merging inference" step.

@jonathanstiansen
Copy link

I had the same problem. It was on a very new project (a few files all under 20-30 lines long). Initialized flow and it was doing this for over 20 minutes until I cancelled it.

@yqz0203
Copy link

yqz0203 commented Jan 15, 2018

@arypurnomoz It works! Thanks!

@TrySound
Copy link
Contributor

Is this still relevant?

@TrySound TrySound closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests