-
Notifications
You must be signed in to change notification settings - Fork 130
Compilation errors kill gulp watch: Error [ERR_STREAM_PUSH_AFTER_EOF]: stream.push() after EOF #569
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
Comments
It's also kinda strange that I see the compiler error twice:
Not sure if that is related. |
I guess that it might be caused by the usage of |
Hmm, that's strange. This does work (but with one issue): gulp.task('build', async function task() {
const project = gulpTypescript.createProject('tsconfig.json', {
declaration: true
});
const ts = project(gulpTypescript.reporter.fullReporter(true));
gulp.src('index.ts').pipe(ts);
await pumpPromise(
ts.js,
gulp.dest('lib')
);
await pumpPromise(
ts.dts,
gulp.dest('lib')
);
}); If I do that though,
Any idea how I can get it to fail properly without using |
Could you try to remove the other usages of |
Same deal with just this: gulp.task('build', function task() {
const project = gulpTypescript.createProject('tsconfig.json', {
declaration: true
});
const ts = project(gulpTypescript.reporter.fullReporter(true));
return gulp.src('index.ts').pipe(ts);
}); |
After re-reading your previous post, it seems that that behavior is correct. It says that it had one error, that the code generation succeeded, and finally that the task finished. Note that TypeScript can still generate JavaScript code, even when there are type errors. If you don't want that, you should set |
Makes sense I guess, but this makes things even stranger: gulp.task('build', function task() {
const project = gulpTypescript.createProject('tsconfig.json', {
declaration: true,
noEmitOnError: true
});
const ts = project(gulpTypescript.reporter.fullReporter(true));
return gulp.src('index.ts').pipe(ts);
});
It reports success, and also reports the same error twice. |
The duplicate error is tracked by #543. It does not report success, it just shows that the task is finished. That message is also controlled by gulp and not by gulp-typescript. |
Failed tasks should show this in gulp's output:
Example failing task: gulp.task('fail', async function task() {
throw new Error('test');
}); |
Sadly that doesn't work with streams, as streams in NodeJS break when one part errors. This would cause that the whole watch process crashes. |
Yeah, I know. It's a pain. That's what I guess I'll have to work around it by writing the event listeners manually. Otherwise the exit code will report success, and use with a CI is very difficult. |
The crashing on errors and exit code has changed in the latest alpha release (5.0.0-alpha.1), see #295. I'm afraid that we can't solve the problems with |
Uh oh!
There was an error while loading. Please reload this page.
Expected behavior:
Expected that failed builds would not force gulp watch to shutdown.
Actual behavior:
Failed builds throw uncaught exceptions.
Your gulpfile:
gulpfile.babel.js
(using Gulp 4)tsconfig.json
Include your tsconfig, if related to this issue.
Here's a Gits to demonstrate the error
First run:
Then edit
index.ts
and replaceclass Greeter
withclass GreeterBad
and see:If a watch task fails, it shouldn't kill the watch, as that's a huge pain to restart every time it fails.
The text was updated successfully, but these errors were encountered: