首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >最新的角度升级导致NullInjectorError: R3InjectorError(n)

最新的角度升级导致NullInjectorError: R3InjectorError(n)
EN

Stack Overflow用户
提问于 2022-04-17 09:44:34
回答 2查看 949关注 0票数 0

一到两周前,我升级到了最新版本的网页应用程序,它可以正常工作。现在,每当我们进入登录页面(它注入了一次工作的AuthService),浏览器将返回一个错误消息,如下所示:

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(n)[AuthService -> _w -> _w -> _w]: NullInjectorError: No provider for _w! NullInjectorError: R3InjectorError(n)[AuthService -> _w -> _w -> _w]: NullInjectorError: No provider for _w!

源头被追踪到polyfill.js。我读到它与webpack最新的升级有关,但我找不到如何修复它的信息。到底是怎么回事?我该怎么补救呢?

当我关闭优化时,我得到了:

Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[AuthService -> Auth -> Auth -> Auth]: NullInjectorError: No provider for Auth!

这只是稍微多了一点信息。

EN

Stack Overflow用户

发布于 2022-04-18 16:30:47

实际上,我想出了答案并解决了问题。基本上,我在我的Auth模块中导入了AuthService类,这在角13出现之前是合适的。现在,根据本教程:

https://www.positronx.io/full-angular-firebase-authentication-system/

您应该从AngularFireAuth中导入@angular/fire/compat/auth。我重新分解了我的代码,它就像一种魅力。

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71900852

复制
相关文章

相似问题

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