将Typescript版本从2.8.4升级到2.9.2时出现了这个奇怪的错误:
ERROR in ./js/main.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: Debug Failure. False expression.
at forEachIdentifierInEntityName (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24094:2
at bindPropertyAssignment (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24044:17)
at bindStaticPropertyAssignment (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24029:13
at bindSpecialPropertyAssignment (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24020:1
at bindWorker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23669:29)
at bind (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23560:13)
at visitNode (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:14777:24)
at Object.forEachChild (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:15021:24)
at bindEachChild (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22352:16)
at bindChildrenWorker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22434:21)
at bindChildren (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22322:17)
at bind (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23571:21)
at C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22328:94
at bindEach (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22344:21)
at bindEachFunctionsFirst (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22328:13)
at bindChildrenWorker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22426:21)
at bindChildren (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22322:17)
at bindContainer (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22270:17)
at bind (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23574:21)
at bindSourceFile (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:21935:17)
at Object.bindSourceFile (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:21876:9)
at initializeTypeChecker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:51156:20)
at Object.createTypeChecker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:27045:9)
at Object.getTypeChecker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:78949:79)
at synchronizeHostData (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:107271:21)
at Object.getEmitOutput (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:107671:13)
at Object.getEmitOutput (C:\devel\autostream-web\node_modules\ts-loader\dist\instances.js:187:41)
at getEmit (C:\devel\autostream-web\node_modules\ts-loader\dist\index.js:196:37)
at successLoader (C:\devel\autostream-web\node_modules\ts-loader\dist\index.js:34:11)
at Object.loader (C:\devel\autostream-web\node_modules\ts-loader\dist\index.js:21:12)
这是我的tsconfig.json:
{
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": true,
"module": "es6",
"target": "es6",
"lib": [
"es2017",
"dom"
],
"allowJs": true,
"allowSyntheticDefaultImports" : true,
"experimentalDecorators": true
}
}
问题:如何获得合适的错误消息以及我做错了什么?而且,我也看到this问题,但我对解决方案和解释不满意 - 我需要使用至少相同的目标,不要将其回滚到'es3',这是默认值。< / p>
答案 0 :(得分:1)
一个web search找到TypeScript bug 24111,它在TypeScript 3.0.1中已修复。尝试升级TypeScript。如果问题仍然存在,请按照以下步骤提交新的TypeScript错误。
答案 1 :(得分:-1)
尝试在与项目相同的目录中执行“ npm i typescript”。