Closed Hesquibet closed 9 years ago
Thanks for reporting, I'll take a look
Sorry for the long delay. I've tried to reproduce your problem. Have you tried using version 2.8.0? With that version I can't reproduce your issue. Did updating solve your issue?
Hello Ivogabe, Thank you for taking time to answer me. I have followed your advices, but i still have the problem with the 2.8.0 version. I have published my repo so that it can help reproduce https://github.com/Hesquibet/Vigoo
Thanks for the repo. You're using the same project in multiple tasks. That's not supported (see #169). I'll add a better error message soon as the current is more confusing than helpful.
A fix for you would be to either create multiple tsProjects or compile all sources in one task. I recommend the second. When compiling the sources in multiple tasks, some files are parsed multiple times (because they are referenced from other modules). If you want to lower compilation times when a part of your program needs to be recompiled, I'd suggest using incremental compilation (see the readme).
Did this solve your problem?
Ok thanks a lot of the detailed explanations & advices. I couldn't make it work on the same task (as i want one file per directory i had to use merge2), but it did make it work with multiple projects. Anyways, problem fixed, thanks again !
+1 for clearer message. I think this is still an issue.
@DmitryEfimenko Added in dead53940fdf704f809bacaec61df9337bae2c07
@ivogabe Now I get compilation errors from my watch
tasks.
If more than one .ts
file gets modified in a short interval of time, the watch
task kicks in more than once and because of the new error the second one (which is the one I'm most interested in) fails because the ts project is already in use...
What is the proper way?
@jods4 I cannot reproduce that. Do you return the stream in your compile task? If not, gulp doesn't know when the task is finished. Otherwise, can you post your gulpfile?
Sure, here you have the relevant part (Gulp 4)
var ts = require("gulp-typescript");
var tsProject = ts.createProject('App/tsconfig.json', { typescript: require('typescript'), noExternalResolve: true });
// Bundle all App/**/*.ts files into main.js
function buildApp() {
var babel = require("gulp-babel");
var gulpif = require("gulp-if");
return gulp.src(['App/**/*.ts', 'App/.d.ts/**/*.d.ts', 'App/*.js'])
.pipe(ts(tsProject))
.js
.pipe(babel({ presets: ['es2015-loose'], compact: true }))
.pipe(gulpif(options.minify, uglify()))
.pipe(gulp.dest('wwwroot/dist'));
}
gulp.task("watch", function () {
gulp.watch("App/**/*.ts", buildApp);
gulp.watch("Icons/*", buildIcons);
gulp.watch("Less/**/*.less", buildLess);
gulp.watch("Views/**/*.html", buildViews);
});
I think the problem is simply that there are concurrent buildApp
running because watch
triggers on each change. Or am I doing something wrong?
EDIT I need to point out that this happens only when I have multiple changes in rapid succession (i.e. faster than the compilation time). Then in the console I see two appBuild
and the second fails because the ts project is already in use (by the first one obvisouly).
If I wait until they all complete and do a single change, the watch
picks it up and appBuild
completes fine.
Hello,
I'm trying to build my project using this task
When i try to compile i get the following error
for extra info my project has 2 TS files in two folders:
both are external module compiled using amd, and command line compile with TSC works.
CoreModule requries Infrastructure Module as such :
Moreover i noticed that in the "Debug Information" it could not find the file at
which is normal as the real path is
I hope i gave enough informations,
Thank you in advance for your answer.