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

gulp-flowtype is not working for me. Not finding errors. Long running time. #48

Open
saginadir opened this issue Nov 22, 2016 · 10 comments

Comments

@saginadir
Copy link

I am not sure why, when I use gulp-typeflow it takes 12s to run the code and it finds 0 erros, while running "flow" command finds errors missed by gulp-typeflow.

I've replaced gulp meanwhile to work with regular 'flow' cmd command which works with the .flowconfig settings

Previous flow task ( with gulp-flowtype )

gulp.task('flowtypeSrc', () =>
  gulp.src(paths.srcJs)
    .pipe(flow({
      all: true,
      weak: false,
      declarations: './flow-typed/npm',
      killFlow: false,
      beep: true,
      abort: true,
    })) // Add Flow here
);

Output:
...
✔ Flow has found 0 errors
[12:22:05] Finished 'flowtypeSrc' after 11 s
...

Actually fails to find erros... and runs 11 seconds.

My current flow task:

gulp.task('flowtypeSrc', () => {
  try {
    execSync('./node_modules/.bin/flow', { stdio: 'inherit' });
  } catch (e) {
    gulp.stop();
  }
});

Output:
...
Found 1 error
[12:14:17] Finished 'flowtypeSrc' after 308 ms
...

I hope to contribute when I get the time, meanwhile this is a valid solution for others with the same problem.

@saginadir saginadir changed the title gulp-flowtype is broken gulp-flowtype is not working for me. Not finding errors. Long running time. Nov 22, 2016
@faceyspacey
Copy link

+1

@faceyspacey
Copy link

@saginadir what does your replacement gulp task look like?

@saginadir
Copy link
Author

@faceyspacey Here it is:

gulp.task('flowtypeSrc', () => {
  try {
    execSync('./node_modules/.bin/flow', { stdio: 'inherit' });
  } catch (e) {
    if (!e.message.match(new RegExp('Command failed','i'))) {
      console.log(e);
    }
    gulp.stop();
  }
});

It's es6

Notice I am running ./node_modules/.bin/flow command
Just make sure flow-bin npm package is installed.

@faceyspacey
Copy link

@saginadir thanks brother!

@alexxmde-zz
Copy link

The same is happening to me, I have the setup from this tutorial

@alexxmde-zz
Copy link

alexxmde-zz commented Nov 25, 2017

It's my first time using gulp and flow, but I will try to find the issue, as this weekend my wife is out, so I'll bring the party home 🍺 👊 🍻

@alexxmde-zz
Copy link

I have opened a PR to solve that. Basically the application was ignoring all stderr outputs and understanding no outputs as a no errors check.

@saginadir
Copy link
Author

@alexxmde Gotcha Alex :) nice find.

This library seems unmaintained for several years, and it has it's reasons

  1. Gulp is not as used anymore - webpack does a lot of the work these days with the -w flag that watches for changes and recompiles
  2. Most tools come with -w flag that reruns on file change and makes gulp further obsolete
  3. npm can have custom scripts which you can run like "npm run install" or "npm run build" and it further obsoletes gulp
  4. I was just using flow in my JetBrains IDE which gives you the errors in the IDE

But still nice catch :) brings me peace to know it's solved.

@charliedowler
Copy link
Collaborator

Hi all,

@saginadir lists the exact reasons for why I stopped maintaining this project along with being unable to keep up with Flow API changes (I hacked this module together the night that Flow was released 😅, a lot has changed).

I appreciate the contribution @alexxmde, I'll check out your PR.

Cheers,
Charlie

@alexei-bykovski
Copy link

Seems to be a problem in the executable flow file that is located in node_modules/gulp-flowtype/node_modules/flow-bin/vendor/flow. Solved this problem by installing flow-bin yarn add --dev flow-bin and pointing the path to flow process.env.FLOW_BIN = path.resolve(__dirname, 'node_modules/.bin/flow'). Now everything works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants