首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角NodeInvocationException:超过最大调用堆栈大小

角NodeInvocationException:超过最大调用堆栈大小
EN

Stack Overflow用户
提问于 2017-08-17 21:27:40
回答 2查看 632关注 0票数 0

我有一个很长的html文件,所以我把它分成几个组件,然后在app.component.html中插入它们的选择器。我刚刚发现,如果输入两个以上的选择器,它就会显示错误。

代码语言:javascript
复制
NodeInvocationException: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded

这是我的app.component.html --当我运行它时,向我显示错误

代码语言:javascript
复制
<header></header>
 <navbar></navbar>
<router-outlet></router-outlet>
<footer></footer>

你看到这些文件在一起有什么错误吗?

header.component.html ->标头选择器

代码语言:javascript
复制
<header class="masthead signature-dierk">
    <div class="container-fluid">
        <div class="row">
            <article class="col-md-6">
            </article>
            <article class="col-md-6">
            </article>
        </div>
    </div>
</header>

堆栈跟踪

代码语言:javascript
复制
    An unhandled exception occurred while processing the request.

NodeInvocationException: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at Object.exports.createElement (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\main-server.js:17873:23)
at Parse5DomAdapter.createElement (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\main-server.js:4010:28)
at EmulatedEncapsulationServerRenderer2.DefaultServerRenderer2.createElement (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\main-server.js:4937:51)
at EmulatedEncapsulationServerRenderer2.createElement (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\main-server.js:5157:66)
at BaseAnimationRenderer.createElement (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\main-server.js:15768:30)
at createElement (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\vendor.js:20116:27)
at createViewNodes (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\vendor.js:23093:44)
at callViewAction (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\vendor.js:23573:13)
at execComponentViewsAction (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\vendor.js:23482:13)
at createViewNodes (E:\פרוייקטים\פרוייקטים קיץ\Asp.net\Baber_App\Baber_App\ClientApp\dist\vendor.js:23154:5)
Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance+<InvokeExportAsync>d__7.MoveNext()
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-08-17 22:18:48

header是一个html5标记,不应该用作任何组件的选择器。我建议在组件中使用破折号,比如app-header

票数 1
EN

Stack Overflow用户

发布于 2017-08-17 22:18:24

解决方案是将标头选择器更改为app头,以便

代码语言:javascript
复制
<app-header></app-header>

不要忘记在选择器中也更改header.component.ts

代码语言:javascript
复制
    selector: 'app-header',
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45745198

复制
相关文章

相似问题

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