facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 682 forks source link

"Flow: Waiting for diagnostics" spinner runs indefinitely #1203

Open ffxsam opened 7 years ago

ffxsam commented 7 years ago

Issue and Steps to Reproduce

The Flow busy spinner appears to be spinning indefinitely.

Expected Behavior

I imagine it should stop at some point.

Actual Behavior

Spins forever.

Versions

Additional Details

image

cullophid commented 7 years ago

+1

nblainrisksense commented 7 years ago

I have this issue as well when downgrading to a previous version of Flow. I need to be able to do this often because not all of my branches are using the same version of flow.

nblainrisksense commented 7 years ago

Just found something that works for me. I was not using the [version] section in the .flowconfig. Once I add this to the flow config and restarted the Nuclide server it worked for me. However, this doesn't seem like it should have happened since I have the version declared in my package.json file and (using Atom) adjusted the path to the new flow exe. Other team members did not have this problem.

mengxingshike2012 commented 7 years ago

any suggestions? every time i change my .flowconfig file , it will reloading and sometimes endless

Axlle commented 7 years ago

+1

Jma353 commented 7 years ago

+1

george-norris-salesforce commented 7 years ago

+1

nahuelhds commented 7 years ago

In my case, I went to the root project at command line and ran flow, it gave me something like this:

Launching Flow server for D:\dev\my-project
Wrong version of Flow. The config specifies version ^0.45.0 but this is version 0.49.1
Could not start Flow server!

So I've modified my .flowconfig to my exact same version. After that it worked like a charm.

Axlle commented 7 years ago

@nahuelhds thanks.

I found that running "flow"

$ flow version
Flow, a static type checker for JavaScript, version 0.47.0

wasn't the same version as "yarn flow"

$ yarn flow version
yarn flow v0.23.4
Flow, a static type checker for JavaScript, version 0.45.0
✨  Done in 0.19s.

Bumping the flow dependency in package.json and .flowconfig to 0.47.0 made Atom happy 😀

TJTorola commented 7 years ago

I'm getting the infinite spinner as well, though going to the root of my project and running flow works fine with both my globally installed flow and node_modules/.bin/flow.

Also whenever I open a new file I get more "Flow: Waiting for diagnostics" messages as seen in the attached screenshot.

screen shot 2017-08-19 at 7 36 09 pm

Atom: 1.19.2 Nuclide: 0.245.0 Flow: 0.53.1

Community Packages (11) /Users/TJTorola/.atom/packages
├── busy-signal@1.4.3 (disabled)
├── file-icons@2.1.11
├── intentions@1.1.5 (disabled)
├── js-refactor@0.7.5
├── language-babel@2.71.0
├── linter@2.2.0 (disabled)
├── linter-ui-default@1.6.7 (disabled)
├── nuclide@0.245.0
├── prettier-atom@0.37.0
├── pure-syntax@0.3.0
└── refactor@0.11.5
eliseumds commented 7 years ago

When firing up flow from the terminal, you'll see the path to a log file. Tail that file (tail -f PATH_HERE) and check whether it is running out of memory. If so, it probably means you have to ignore directories in your .flowconfig. By default, it will look for every single file inside the project root, so be very careful. Here's my current config (Flow 0.54.0):

[include]

[ignore]
.*/\.git/.*
<PROJECT_ROOT>/\.happypack/.*
<PROJECT_ROOT>/node_modules/.*

[libs]

[options]
module.system.node.resolve_dirname=node_modules
# Module aliasing (NODE_PATH)
module.system.node.resolve_dirname=src/clients

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe

esproposal.class_instance_fields=enable
esproposal.class_static_fields=enable

# webpack loaders
module.name_mapper='.*\.s?css$' -> '<PROJECT_ROOT>/flow/styles-loader.js'
module.name_mapper='.*\.\(svg\|png\|jpg\|gif\)$' -> '<PROJECT_ROOT>/flow/url-loader.js'
matzero commented 7 years ago

Solved it by downgrading the version of flow from ^0.54.1 to ^0.49.1 This might not be optimal but will get you working again.

ahmadalfy commented 7 years ago

Downgrading didn't resolve it to me. Any idea how to resolve it?

mdietsche commented 7 years ago

+1

astrotim commented 6 years ago

+1

PatrickStrz commented 6 years ago

+1

MarcoNicolodi commented 6 years ago

+1

Svehla commented 6 years ago

+1

marcelohenrique180 commented 6 years ago

I solved it by installing flow-bin globally:

npm i -g flow-bin

And running flow on the terminal. It pointed to me that my .flowconfig had a mistype.

If it doesn't solve you could try installing locally and then setting the config 'Path to flow Executable on Nuclide options to your_project_path/node_modules/flow-bin/flow-{your_sys}-{your_versioni}/flow

The problem will probably be pointed out by running flow on a terminal.

caseybaggz commented 6 years ago

I solved it by matching both my global/local flow versions and adding it to the .flowconfig using version 0.69.0

After doing so, I then ran flow and nuclide finally started showing flow hints again.