SteveSanderson / generator-ko

63 stars 39 forks source link

Out of the box: Typescript errors on Windows (aka. update TypeScript) #12

Open Grovespaz opened 9 years ago

Grovespaz commented 9 years ago

On Windows I get this on a clean install (on Linux it works):

C:\Users\Grovespaz\Documents\Code\test-project>gulp ts
[19:37:59] Using gulpfile ~\Documents\Code\test-project\gulpfile.js
[19:37:59] Starting 'ts'...
[19:38:00] Compiling TypeScript files using tsc version 1.0.1.0
[19:38:02] [tsc] > C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.js:965
[19:38:02] [tsc] >                 throw new Error("Debug Failure. False expression: " + message
[19:38:02] [tsc] >                       ^
[19:38:02] [tsc] > Error: Debug Failure. False expression: Should not use a released bitvector
[19:38:02] [tsc] >     at Function.Debug.assert (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescrip
t\bin\tsc.js:965:23)
[19:38:02] [tsc] >     at BitVectorImpl.valueAt (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescrip
t\bin\tsc.js:755:34)
[19:38:02] [tsc] >     at BitMatrixImpl.valueAt (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescrip
t\bin\tsc.js:881:31)
[19:38:02] [tsc] >     at PullTypeSymbol._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse (C:\Users\Grovespaz\Doc
uments\Code\test-project\node_modules\typescript\bin\tsc.js:38026:74)
[19:38:02] [tsc] >     at PullInstantiatedTypeReferenceSymbol.PullTypeSymbol._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeR
eferenceStructure (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.js:38084:56)
[19:38:02] [tsc] >     at PullInstantiatedTypeReferenceSymbol.PullTypeSymbol._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeR
eferenceWorker (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.js:38057:70)
[19:38:02] [tsc] >     at PullInstantiatedTypeReferenceSymbol.PullTypeSymbol._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeR
eferenceRecurse (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.js:38036:62)
[19:38:02] [tsc] >     at PullInstantiatedTypeReferenceSymbol.PullTypeSymbol.wrapsSomeTypeParameterIntoInfinitelyExpandingTypeRe
ference (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.js:38020:66)
[19:38:02] [tsc] >     at PullInstantiatedTypeReferenceSymbol.getGenerativeTypeClassification (C:\Users\Grovespaz\Documents\Code\b
itgate.bitbook.frontend\node_modules\typescript\bin\tsc.js:56587:30)
[19:38:02] [tsc] >     at PullTypeEnclosingTypeWalker.getGenerativeClassification (C:\Users\Grovespaz\Documents\Code\bitgate.bitbo
ok.frontend\node_modules\typescript\bin\tsc.js:38846:36)
[19:38:02] [tsc] >     at PullTypeResolutionContext.oneOfClassificationsIsInfinitelyExpanding (C:\Users\Grovespaz\Documents\Code\b
itgate.bitbook.frontend\node_modules\typescript\bin\tsc.js:39598:71)
[19:38:02] [tsc] >     at PullTypeResolver.typesAreIdenticalInEnclosingTypes (C:\Users\Grovespaz\Documents\Code\bitgate.bitbook.fr
ontend\node_modules\typescript\bin\tsc.js:47714:29)
[19:38:02] [tsc] >     at PullTypeResolver.signatureTypeParametersParametersAndReturnTypesAreIdentical (C:\Users\Grovespaz\Document
s\Code\test-project\node_modules\typescript\bin\tsc.js:48034:55)
[19:38:02] [tsc] >     at PullTypeResolver.signaturesAreIdenticalWorker (C:\Users\Grovespaz\Documents\Code\bitgate.bitbook.fronten
d\node_modules\typescript\bin\tsc.js:48005:75)
[19:38:02] [tsc] >     at PullTypeResolver.signaturesAreIdentical (C:\Users\Grovespaz\Documents\Code\test-project\node
_modules\typescript\bin\tsc.js:47976:40)
[19:38:02] [tsc] >     at PullTypeResolver.signaturesAreIdenticalWithNewEnclosingTypes (C:\Users\Grovespaz\Documents\Code\bitgate.
bitbook.frontend\node_modules\typescript\bin\tsc.js:47957:47)
[19:38:02] [tsc] >     at PullTypeResolver.typeCheckFunctionOverloads (C:\Users\Grovespaz\Documents\Code\test-project\
node_modules\typescript\bin\tsc.js:49414:30)
[19:38:02] [tsc] >     at C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.js:42863:23
[19:38:02] [tsc] >     at Function.PullTypeResolver.typeCheck (C:\Users\Grovespaz\Documents\Code\test-project\node_mod
ules\typescript\bin\tsc.js:49358:21)
[19:38:02] [tsc] >     at TypeScriptCompiler.getSemanticDiagnostics (C:\Users\Grovespaz\Documents\Code\test-project\no
de_modules\typescript\bin\tsc.js:55508:41)
[19:38:02] [tsc] >     at CompilerIterator.moveNextSemanticsPhase (C:\Users\Grovespaz\Documents\Code\test-project\node
_modules\typescript\bin\tsc.js:56137:45)
[19:38:02] [tsc] >     at CompilerIterator.moveNextInternal (C:\Users\Grovespaz\Documents\Code\test-project\node_modul
es\typescript\bin\tsc.js:56087:33)
[19:38:02] [tsc] >     at CompilerIterator.moveNext (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\types
cript\bin\tsc.js:56062:25)
[19:38:02] [tsc] >     at BatchCompiler.compile (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescrip
t\bin\tsc.js:62412:20)
[19:38:02] [tsc] >     at BatchCompiler.batchCompile (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\type
script\bin\tsc.js:62251:22)
[19:38:02] [tsc] >     at TypeScript (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\bin\tsc.j
s:62928:11)
[19:38:02] [tsc] >     at Object.<anonymous> (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\b
in\tsc.js:62929:3)
[19:38:02] [tsc] >     at Module._compile (module.js:460:26)
[19:38:02] [tsc] >     at Object.Module._extensions..js (module.js:478:10)
[19:38:02] [tsc] >     at Module.load (module.js:355:32)
[19:38:02] [tsc] >     at Function.Module._load (module.js:310:12)
[19:38:02] [tsc] >     at Module.require (module.js:365:17)
[19:38:02] [tsc] >     at require (module.js:384:17)
[19:38:02] [tsc] >     at Object.<anonymous> (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\typescript\b
in\tsc:2:1)
[19:38:02] [tsc] >     at Module._compile (module.js:460:26)
[19:38:02] [tsc] >     at Object.Module._extensions..js (module.js:478:10)
[19:38:02] [tsc] >     at Module.load (module.js:355:32)
[19:38:02] [tsc] >     at Function.Module._load (module.js:310:12)
[19:38:02] [tsc] >     at Function.Module.runMain (module.js:501:10)
[19:38:02] [tsc] >     at startup (node.js:129:16)
[19:38:02] [tsc] >     at node.js:814:3
[19:38:02] Failed to compile TypeScript: Error: tsc command has exited with code:1

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Failed to compile: tsc command has exited with code:1
    at C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\index.js:51:33
    at C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\lib\compiler.js:283:8
    at Array.forEach (native)
    at Function.Compiler._allAborted (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\lib\compile
r.js:282:13)
    at Function.Compiler.abortAll (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\lib\compiler.j
s:260:14)
    at C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\index.js:50:20
    at C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\lib\compiler.js:109:7
    at Transform.<anonymous> (C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\lib\compiler.js:204
:5)
    at Transform.emit (events.js:129:20)
    at C:\Users\Grovespaz\Documents\Code\test-project\node_modules\gulp-tsc\node_modules\through2\node_modules\readabl
e-stream\lib\_stream_readable.js:965:16
dimi-nk commented 9 years ago

I have the same problem. I created a typescript scaffold. I haven't changed anything. When running gulp, it seems to grab .ts files from the node_modules folder and fails to finish the compilation.

To fix this, edit the src pattern of the ts task. gulp.task('ts', function() { return gulp.src(['**/*.ts', '!node_modules/**'])

I created a pull request to fix this.