首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角8和.NET核心类型'Observable<Profile>‘不能指定键入'Observable<IUser>’

角8和.NET核心类型'Observable<Profile>‘不能指定键入'Observable<IUser>’
EN

Stack Overflow用户
提问于 2020-04-26 11:55:38
回答 1查看 687关注 0票数 1

我有应用在角8和.NET核心。我的应用程序是由Visualu的模板生成的,所以授权也是生成的。

代码语言:javascript
复制
It has been working great but suddenly I get errors like that, when I started my application:
ERROR in api-authorization/authorize.service.ts:78:29 - error TS2345: Argument of type 'Profile' is not assignable to parameter of type 'IUser'.
  Property 'name' is optional in type 'Profile' but required in type 'IUser'.

78       this.userSubject.next(user.profile);
                               ~~~~~~~~~~~~
api-authorization/authorize.service.ts:89:31 - error TS2345: Argument of type 'Profile' is not assignable to parameter of type 'IUser'.

89         this.userSubject.next(user.profile);
                                 ~~~~~~~~~~~~
api-authorization/authorize.service.ts:115:29 - error TS2345: Argument of type 'Profile' is not assignable to parameter of type 'IUser'.

115       this.userSubject.next(user && user.profile);
                                ~~~~~~~~~~~~~~~~~~~~
api-authorization/authorize.service.ts:150:42 - error TS2339: Property 'data' does not exist on type 'SignoutResponse'.

150       return this.success(state && state.data);
                                             ~~~~
api-authorization/authorize.service.ts:195:5 - error TS2322: Type 'Observable<Profile>' is not assignable to type 'Observable<IUser>'.
  Type 'Profile' is not assignable to type 'IUser'.

我记得我更新了角质材料,大概仅此而已。我不知道为什么突然间我会犯这些错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-27 02:17:23

这是我问题的解决方案:https://github.com/dotnet/aspnetcore/issues/17919

@SyntaxWarrior --我遇到了同样的问题。我在我的package.json中修改了它,但这还不够,因为它仍然是通过Packe-lock.json引用的(我想是这样)。

我运行的命令是npm i oidc-client@1.9.1

唯一的问题是它给了我一堆新的与“路由器链接”相关的错误。看起来有一些地方需要将RouterTestingModule导入到api授权规范中。

问题是软件包oidc客户。在1.10.1版中是概要文件。我不得不降级到1.9.1版,现在它开始工作了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61440305

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档