Skip to content

Error: Debug Failure. False expression: length must be non-negative, is NaN #15

@YoshiWalsh

Description

@YoshiWalsh

Using reflec-ts 0.3.9 with Node 8.6.0. I have the following basic project structure:

src/tests.js

class testClassA {
    a: string
}

console.log(new testClassA());

tsconfig.json

{
    "compileOnSave": true,
    "include": [
        "src/*"
    ],
    "compilerOptions": {
        "target": "ES2017",
        "noImplicitAny": true,
        "removeComments": false,
        "sourceMap": true,
        "outDir": "build"
    },
    "reflectionEnabled": true
}

I'm running this command:

node d:\git\test-project\node_modules\reflec-ts\bin\tsc -p d:\git\test-project

I get the following output:

d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:53636
throw e;
^

Error: Debug Failure. False expression: length must be non-negative, is NaN
at Object.assert (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:2834:23)
at Object.createFileDiagnostic (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:2004:15)
at createDiagnosticForNodeInSourceFile (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:7304:19)
at Object.createDiagnosticForNode (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:7299:16)
at error (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:22449:22)
at resolveName (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:22891:25)
at getResolvedSymbol (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:29693:67)
at checkIdentifier (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:30742:26)
at checkExpressionWorker (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:34344:28)
at checkExpression (d:\git\test-project\node_modules\reflec-ts\lib\tsc.js:34328:42)
The terminal process terminated with exit code: 1

If I change reflectionEnabled to false in tsconfig.json then the build succeeds. Not sure what I'm doing wrong! It's weird because I've successfully used reflec-ts before, but it was on a different PC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions