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

Running task with typescript 3.6.2 throws error #625

Closed
thviQit opened this issue Aug 30, 2019 · 1 comment
Closed

Running task with typescript 3.6.2 throws error #625

thviQit opened this issue Aug 30, 2019 · 1 comment

Comments

@thviQit
Copy link

thviQit commented Aug 30, 2019

Using a task to compile typescript, produces the following:

gulp typescript-compile --gulpfile Gulpfile.js
[12:43:11] Using gulpfile ***path***\Gulpfile.js
[12:43:11] Starting 'typescript-compile'...
***path***/node_modules/cypress/types/jquery/index.d.ts(8155,87): error TS2344: Type '"button" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | "charCode" | ... 13 more ... | "touches"' does not satisfy the constraint '"repeat" | "button" | "code" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | ... 55 more ... | "DOM_KEY_LOCATION_STANDARD"'.
  Type '"toElement"' is not assignable to type '"repeat" | "button" | "code" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | ... 55 more ... | "DOM_KEY_LOCATION_STANDARD"'.
TypeScript: 1 semantic error
TypeScript: emit failed
[12:43:16] 'typescript-compile' errored after 5.46 s
[12:43:16] Error: TypeScript: Compilation failed
    at Output.mightFinish (***path***\node_modules\gulp-typescript\release\output.js:130:43)
    at Output.finish (***path***\node_modules\gulp-typescript\release\output.js:122:14)
    at ProjectCompiler.inputDone (***path***\node_modules\gulp-typescript\release\compiler.js:95:29)
    at CompileStream.end (***path***\node_modules\gulp-typescript\release\project.js:122:31)
    at DestroyableTransform.onend (***path***\node_modules\readable-stream\lib\_stream_readable.js:577:10)
    at Object.onceWrapper (events.js:277:13)
    at DestroyableTransform.emit (events.js:194:15)
    at DestroyableTransform.EventEmitter.emit (domain.js:459:23)
    at endReadableNT (***path***\node_modules\readable-stream\lib\_stream_readable.js:1010:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

This error occured on our build agent yesterday, and I was able to fix it today, by limiting npm to typescript 3.5.3. So something doesn't work with typescript 3.6.2, which was released August 28th (after our evening build).

Expected behavior:
That the compile goes well

Actual behavior:
See above

Your gulpfile:

"use strict";
/// <binding BeforeBuild='typescript-compile'/>
var gulp = require("gulp");
var ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json', { rootDir: "src" });
gulp.task('typescript-compile', function () {
    var tsResult = tsProject.src()
        .pipe(tsProject());
    return tsResult.js.pipe(gulp.dest('cypress'));
});

tsconfig.json

{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": false,
    "module": "commonjs",
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "lib": [ "es5", "dom" ],
    "allowJs": true,
    "baseUrl": "../node_modules",
    "types": [
      "cypress"
    ]
  },
  "include": [
    "**/*.*"
  ],
  "exclude": [
    "node_modules"
  ]
}

package.json

{
  "name": "***",
  "version": "1.0.0",
  "description": "***",
  "main": "app.js",
  "author": {
    "name": "***"
  },
  "scripts": {
    "start": "echo",
    "cyrun": "./node_modules/.bin/cypress run",
    "cyop": "./node_modules/.bin/cypress open"
  },
  "devDependencies": {
    "@types/node": "^12.0.8",
    "cypress": "^3.3.1",
    "gulp": "^4.0.2",
    "gulp-typescript": "^5.0.1",
    "mocha": "^5.2.0",
    "mocha-junit-reporter": "^1.22.0",
    "mocha-multi-reporters": "^1.1.7",
    "typescript": "^3.5.2" (now "~3.5.2")
  },
  "dependencies": {}
}

Hope you can help, so we are not stuck at version 3.5.3 :)

@thviQit
Copy link
Author

thviQit commented Aug 30, 2019

Apparently this is a bug from Cypress.Io (cypress-io/cypress#5065) - closing

@thviQit thviQit closed this as completed Aug 30, 2019
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

1 participant