-
-
Save junosuarez/7cd1433497897e64af9f to your computer and use it in GitHub Desktop.
Typescript error with --allowJavaScript - clone with git clone [email protected]:7cd1433497897e64af9f.git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hi () { | |
return 'hi' | |
} | |
module.exports = hi | |
// compiles fine with: | |
// module.exports = function hi () { | |
// return 'hi' | |
// } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> tsc --version | |
Version 1.9.0-dev.20160131 | |
> tsc --allowJs --outDir foo index.js | |
/usr/local/lib/node_modules/typescript/lib/tsc.js:33194 | |
throw e; | |
^ | |
TypeError: Cannot read property 'kind' of undefined | |
at getTargetOfAliasDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:12347:25) | |
at resolveAlias (/usr/local/lib/node_modules/typescript/lib/tsc.js:12371:30) | |
at resolveSymbol (/usr/local/lib/node_modules/typescript/lib/tsc.js:12363:101) | |
at resolveExternalModuleSymbol (/usr/local/lib/node_modules/typescript/lib/tsc.js:12499:52) | |
at resolveExternalModuleTypeByLiteral (/usr/local/lib/node_modules/typescript/lib/tsc.js:14915:44) | |
at checkCallExpression (/usr/local/lib/node_modules/typescript/lib/tsc.js:19439:24) | |
at checkExpressionWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:20314:28) | |
at checkExpression (/usr/local/lib/node_modules/typescript/lib/tsc.js:20264:42) | |
at checkExpressionCached (/usr/local/lib/node_modules/typescript/lib/tsc.js:20225:38) | |
at getTypeForVariableLikeDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:13672:24) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = require('./b') | |
console.log(a(), 'world') | |
module.exports = a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment