Skip to content

gulp-typescript compiler option errors (Version : 3.1.0) #450

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

Closed
pkapare opened this issue Oct 28, 2016 · 5 comments
Closed

gulp-typescript compiler option errors (Version : 3.1.0) #450

pkapare opened this issue Oct 28, 2016 · 5 comments

Comments

@pkapare
Copy link

pkapare commented Oct 28, 2016

Expected behavior:

Actual behavior:
On running gulp task I am getting following errors:
error TS5023: Unknown compiler option '_readableState'.
error TS5023: Unknown compiler option 'readable'.
error TS5023: Unknown compiler option 'domain'.
error TS5023: Unknown compiler option '_events'.
error TS5023: Unknown compiler option '_eventsCount'.
error TS5023: Unknown compiler option '_maxListeners'.
error TS5023: Unknown compiler option '_writableState'.
error TS5023: Unknown compiler option 'writable'.
error TS5023: Unknown compiler option 'allowHalfOpen'.
error TS5023: Unknown compiler option 'js'.
error TS5023: Unknown compiler option 'dts'.
error TS5024: Compiler option 'project' requires a value of type string.
Your gulpfile:
Include your gulpfile, or only the related task (with ts.createProject).

var paths = {
    source: {
        config: './tsconfig.json'       
    },
    build: {
        config: path.join('dist', argv.app, 'config'),
    }
}
gulp.task('transpile:env', function () {

    var tsProject = tsc.createProject(paths.source.config);

    var envfile = env.is.production() ? 'env.config.prod.ts' : 'env.config.dev.ts';
    envfile = 'config/' + envfile;

    var sourcefiles = [envfile];
    var tsResult = gulp.src(sourcefiles)
        .pipe(tsc(tsProject(),tsc.reporter.defaultReporter()));
    return tsResult.js
        .pipe(concat('env.config.js'))
        .pipe(gulp.dest(paths.build.config));
});

tsconfig.json

Include your tsconfig, if related to this issue.

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "suppressImplicitAnyIndexErrors": true,
    "listEmittedFiles": false,
    "suppressExcessPropertyErrors": true,
    "listFiles": false,
    "pretty": true,
    "typeRoots": [
      "./node_modules/@types/"
    ]
  },
  "exlude":[
    "node_modules",
    "node_modules/@types"
  ]
}

Code

Include your TypeScript code, if necessary.

@ivogabe
Copy link
Owner

ivogabe commented Oct 28, 2016

Looks like a duplicate of #449. Upgrading to version 3.1.1

@ivogabe ivogabe closed this as completed Oct 28, 2016
@ivogabe
Copy link
Owner

ivogabe commented Oct 28, 2016

Sorry, that's not the case.

@ivogabe ivogabe reopened this Oct 28, 2016
@ivogabe
Copy link
Owner

ivogabe commented Oct 28, 2016

The problem is in the following expression: tsc(tsProject(),tsc.reporter.defaultReporter()). You're now passing a stream (namely tsProject()) as the compiler options object. You should write this as tsProject(tsc.reporter.defaultReporter()). When you change that line, everything should be working fine.

@pkapare
Copy link
Author

pkapare commented Oct 28, 2016

Perfect! That fixed those errors. I got confused with "Revised API of main function" at http://dev.ivogabe.com/gulp-typescript-3/ which says : The first argument options accepts either an object with compiler options, or a 'project', created by ts.createProject.

@pkapare pkapare closed this as completed Oct 28, 2016
@ivogabe
Copy link
Owner

ivogabe commented Oct 28, 2016

The old API was tsc(tsProject) (not tsc(tsProject())), which has been replaced by tsProject(). I'll update the post since accepts should be accepted.

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

2 participants