gulp-flowtype
gulp-flowtype copied to clipboard
gulp-flowtype is not working for me. Not finding errors. Long running time.
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.
+1
@saginadir what does your replacement gulp task look like?
@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.
@saginadir thanks brother!
The same is happening to me, I have the setup from this tutorial
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 🍺 👊 🍻
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.
@alexxmde Gotcha Alex :) nice find.
This library seems unmaintained for several years, and it has it's reasons
- 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
- Most tools come with -w flag that reruns on file change and makes gulp further obsolete
- npm can have custom scripts which you can run like "npm run install" or "npm run build" and it further obsoletes gulp
- 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.
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
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.