类型错误:无法在 getAssignmentTargetKind 读取未定义的属性“种类" [英] TypeError: Cannot read property 'kind' of undefined at getAssignmentTargetKind

查看:30
本文介绍了类型错误:无法在 getAssignmentTargetKind 读取未定义的属性“种类"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将我的 Angular 6 项目更新到 7.x 时开始出现此问题.

This problem started to occur when updating my Angular 6 project to 7.x.

我在 angular-cli github 存储库上打开了一个问题,但他们无能为力.

I opened an issue on the angular-cli github repo but they couldn't help.

所以我所做的是创建一个新项目并一个一个添加所有组件,以希望"注意到导致问题的原因.

So what I did is create a new project and add all components one by one to "hopefully" notice what caused the problem.

不幸的是,我无法确定问题所在.这是日志:

Unfortunately I couldn't identify the problem. Here's the log:

ERROR in : TypeError: Cannot read property 'kind' of undefined
at getAssignmentTargetKind (E:\McClient\node_modules\typescript\lib\typescript.js:10049:28)
at Object.isAssignmentTarget (E:\McClient\node_modules\typescript\lib\typescript.js:10092:16)
at checkObjectLiteral (E:\McClient\node_modules\typescript\lib\typescript.js:46107:45)
at checkExpressionWorker (E:\McClient\node_modules\typescript\lib\typescript.js:50748:28)
at checkExpression (E:\McClient\node_modules\typescript\lib\typescript.js:50696:42)
at checkExpressionWithContextualType (E:\McClient\node_modules\typescript\lib\typescript.js:50524:26)
at checkApplicableSignature (E:\McClient\node_modules\typescript\lib\typescript.js:47963:35)
at chooseOverload (E:\McClient\node_modules\typescript\lib\typescript.js:48281:26)
at resolveCall (E:\McClient\node_modules\typescript\lib\typescript.js:48231:26)
at resolveCallExpression (E:\McClient\node_modules\typescript\lib\typescript.js:48534:20)
at resolveSignature (E:\McClient\node_modules\typescript\lib\typescript.js:48800:28)
at getResolvedSignature (E:\McClient\node_modules\typescript\lib\typescript.js:48844:26)
at checkCallExpression (E:\McClient\node_modules\typescript\lib\typescript.js:48936:29)
at checkExpressionWorker (E:\McClient\node_modules\typescript\lib\typescript.js:50759:28)
at checkExpression (E:\McClient\node_modules\typescript\lib\typescript.js:50696:42)
at resolveDecorator (E:\McClient\node_modules\typescript\lib\typescript.js:48741:28)

这是我应该记录的来自 checkSourcefile 函数的日志的 github 问题链接:

Here's a link to the github issue with logs from a checkSourcefile function I was supposed to log:

https://github.com/angular/angular-cli/issues/13172

我如何追踪并(希望)解决导致此问题的原因?

How can I track down and (hopefully) fix what's causing this?

我的 ng --version 信息

My ng --version info

Angular CLI: 7.1.3
Node: 8.11.4
OS: win32 x64
Angular: 7.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.11.3
@angular-devkit/build-angular     0.11.3
@angular-devkit/build-optimizer   0.11.3
@angular-devkit/build-webpack     0.11.3
@angular-devkit/core              7.1.3
@angular-devkit/schematics        7.1.3
@angular/cdk                      7.1.1
@ngtools/webpack                  7.1.3
@schematics/angular               7.1.3
@schematics/update                0.11.3
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.23.1

推荐答案

我只是重新运行

    ng serve

又一次成功了!

这篇关于类型错误:无法在 getAssignmentTargetKind 读取未定义的属性“种类"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆