gpt4 book ai didi

angular - 多个组件匹配带有标记名 app-lobby 的节点

转载 作者:行者123 更新时间:2023-12-03 14:40:13 25 4
gpt4 key购买 nike

代码在 angular 8.3.4 版本上运行良好,但是当我将其更新到最新版本的 angular ( 9 ) 时,出现以下错误

以下是堆栈跟踪

core.js:3866 ERROR Error: Uncaught (in promise): Error: Multiple components match node with tagname app-lobby
Error: Multiple components match node with tagname app-lobby
at throwMultipleComponentError (core.js:5511)
at findDirectiveDefMatches (core.js:8276)
at resolveDirectives (core.js:8080)
at elementStartFirstCreatePass (core.js:14215)
at ɵɵelementStart (core.js:14249)
at Module.ɵɵelement (core.js:14324)
at MainComponent_Template (main.component.html:1)
at executeTemplate (core.js:7562)
at renderView (core.js:7387)
at renderComponent (core.js:8577)
at resolvePromise (zone.js:836)
at resolvePromise (zone.js:795)
at zone.js:897
at ZoneDelegate.invokeTask (zone.js:431)
at Object.onInvokeTask (core.js:27769)
at ZoneDelegate.invokeTask (zone.js:430)
at Zone.runTask (zone.js:198)
at drainMicroTaskQueue (zone.js:611)
at ZoneTask.invokeTask (zone.js:517)
at ZoneTask.invoke (zone.js:502)

最佳答案

可能你有 不止一个具有相同选择器标签名称的组件 app-lobby

...
@Component({
selector: 'app-lobby',
...
请仔细检查以确保只有一个组件选择器标记名称是 app-lobby .

关于angular - 多个组件匹配带有标记名 app-lobby 的节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60482442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com