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

Bug: Recompiles src files many times #150

Closed
cguinnup opened this issue Jun 23, 2016 · 2 comments
Closed

Bug: Recompiles src files many times #150

cguinnup opened this issue Jun 23, 2016 · 2 comments
Labels

Comments

@cguinnup
Copy link

Even after paring our gulpfile down to the small example you see below, I'm getting numerous re-compiles of the same Typescript files. If you see the console output below, main.tsx's test error is reported 11 times in total!

This has been happening since the first time I tried tsify. I have no tsconfig.json and can't think of any other files that might interfere with the build. RHEL 6.6, Node v5.9.0

gulpfile.js

var gulp = require('gulp');
var browserify = require('browserify');
var tsify = require('tsify');
var source = require('vinyl-source-stream');

var b = browserify({
    entries: ['./app/main.tsx']
});
var es6Types = 'node_modules/typescript/lib/lib.es6.d.ts';
var thirdPartyTypes = 'typings/index.d.ts';

b.add(es6Types);
b.add(thirdPartyTypes);
b.plugin(tsify, {
    jsx: "react",
    target: "ES5",
    module: "commonjs"
});

gulp.task('default', function () {
    return b.bundle()
        .on('error', function(e) { console.error(e.message ? e.message : e) })
        .pipe(source('main.js'))
        .pipe(gulp.dest('./dest'));
});

running gulp

[22:09:38] Using gulpfile /web/pane/example/gulpfile.js
[22:09:38] Starting 'default'...
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
/web/pane/example/app/TitleBar.tsx(109,2): Error TS2354: No best common type exists among return expressions.
/web/pane/example/app/TitleBar.tsx(125,2): Error TS2354: No best common type exists among return expressions.
app/UIPane.tsx(162,2): Error TS2354: No best common type exists among return expressions.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
/web/pane/example/app/TitleBar.tsx(109,2): Error TS2354: No best common type exists among return expressions.
/web/pane/example/app/TitleBar.tsx(125,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(53,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(129,2): Error TS2354: No best common type exists among return expressions.
app/UIPane.tsx(162,2): Error TS2354: No best common type exists among return expressions.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
/web/pane/example/app/TitleBar.tsx(109,2): Error TS2354: No best common type exists among return expressions.
/web/pane/example/app/TitleBar.tsx(125,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(53,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(129,2): Error TS2354: No best common type exists among return expressions.
app/UIPane.tsx(162,2): Error TS2354: No best common type exists among return expressions.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
/web/pane/example/app/TitleBar.tsx(109,2): Error TS2354: No best common type exists among return expressions.
/web/pane/example/app/TitleBar.tsx(125,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(53,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(129,2): Error TS2354: No best common type exists among return expressions.
app/UIPane.tsx(162,2): Error TS2354: No best common type exists among return expressions.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
/web/pane/example/app/TitleBar.tsx(109,2): Error TS2354: No best common type exists among return expressions.
/web/pane/example/app/TitleBar.tsx(125,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(53,2): Error TS2354: No best common type exists among return expressions.
app/IOPane.tsx(129,2): Error TS2354: No best common type exists among return expressions.
app/UIPane.tsx(162,2): Error TS2354: No best common type exists among return expressions.
app/main.tsx(7,5): Error TS2322: Type 'number' is not assignable to type 'string'.
[22:10:12] Finished 'default' after 34 s
@cguinnup
Copy link
Author

cguinnup commented Jun 27, 2016

After investigating further, it appears tsify lacks support for any sort of non-local modules, whether referenced by NODE_PATH (using a modified Typescript) or by symlink (#135).

This makes it difficult if not impossible for our org to use tsify, since we have a large number of in-house JS libraries which we cannot afford to duplicate on disk for every project.

@cartant
Copy link
Contributor

cartant commented Aug 7, 2016

This should be closed by #171. It should now be possible to use symlinks in node_modules.

@cartant cartant closed this as completed Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants