Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

getDeclarationOfAliasSymbol assert with shortid npm module in 2@next #10460

Copy link
Copy link
@seanmiddleditch

Description

@seanmiddleditch
Issue body actions

TypeScript Version: 2.1.0 / nightly (2.1.0-dev.20160821)

Error Message

G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:37610                                                            
                throw e;                                                                                                            
                ^                                                                                                                   

Error: Debug Failure. False expression:                                                                                             
    at Object.assert (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:1289:23)                                   
    at Object.fail (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:1294:19)                                     
    at Object.findMap (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:211:15)                                   
    at getDeclarationOfAliasSymbol (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:13927:23)                    
    at checkExternalModuleExports (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:26428:39)                     
    at checkSourceFileWorker (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:26635:21)                          
    at checkSourceFile (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:26610:13)                                
    at Object.forEach (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:185:30)                                   
    at getDiagnosticsWorker (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:26659:16)                           
    at getDiagnostics (G:\Sean\Documents\Projects\test\node_modules\typescript\lib\tsc.js:26647:24)                                 

package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "typings": "typings",
    "tsc": "tsc"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "shortid": "^2.2.6",
    "typescript": "^2.1.0-dev.20160821",
    "typings": "^1.3.2"
  }
}

tsconfig.json

{
    "compileOnSave": true,
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "target": "es6",
        "noImplicitAny": true,
        "strictNullChecks": true,
        "sourceMap": true,
        "allowJs": true,
        "outDir": "bin"
    },
    "files": ["index.ts"]
}

typings.json

{
  "globalDependencies": {
    "shortid": "registry:dt/shortid#0.0.0+20160316155526"
  }
}

index.ts

import * as shortid from 'shortid';

Reproduction Steps

npm install
npm run typings -- install
npm run tsc

Note

Removing the Object.fail in Object.findMap results in a crash-free compilation with no ill-effects that I can observe, including on a somewhat larger project.

shortid is not the only module that causes this. I've also observed debug causing this. I'm not sure how many others my app might be hitting since I can't see latter failures until somehow avoiding former ones.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.