Error: "app" did not match any elements

Error: "app" did not match any elements

我正在创建一个带有 node.js 服务器的 angular2 客户端应用程序。客户端应用程序似乎运行良好,这意味着:

但我在终端中收到此错误:

Error: The selector "app" did not match any elements
    at DomRenderer.selectRootElement (/home/mu-user/Projects/my-app/dist/server/index.js:27126:23)
    at selectOrCreateRenderHostElement (/home/mu-user/Projects/my-app/dist/server/index.js:15687:32)
    at AppView._View_AppComponent_Host0.createInternal (/AppModule/AppComponent/host.ngfactory.js:12:16)
    at AppView.create (/home/mu-user/Projects/my-app/dist/server/index.js:50916:21)
    at ComponentFactory.create (/home/mu-user/Projects/my-app/dist/server/index.js:36656:36)
    at ApplicationRef_.bootstrap (/home/mu-user/Projects/my-app/dist/server/index.js:23313:40)
    at /home/mu-user/Projects/my-app/dist/server/index.js:23222:89
    at Array.forEach (native)
    at Object.Call (/home/mu-user/Projects/my-app/node_modules/es6-shim/es6-shim.js:307:14)
    at Array.forEach (/home/mu-user/Projects/my-app/node_modules/es6-shim/es6-shim.js:1313:17)

不会中断 webpackhttp-server .
问题是为什么我会遇到这个问题,如何解决?

正如我在评论中所描述的那样,我将添加此答案以供记录。此错误已通过修复对 ngModule.
声明列表中包含的模块的引用而解决 从错误消息的上下文中找出问题是很棘手的。而且由于代码的复杂性,不可能包含实际的项目代码,但我在尝试制作一个更简单的版本以准备在此处显示时发现了这个问题。