我正在使用angular2
服务器创建node.js
客户端应用。 clientside app似乎完美无缺,意味着:
但我在终端中收到此错误:
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)
不会中断webpack
或http-server
问题是为什么我要面对这个以及如何解决它?
答案 0 :(得分:0)
我正在添加此答案进行记录,正如我在评论中所述。通过修复ngModule
声明列表中包含的模块的引用来解决此错误
从错误消息的上下文中找出问题是很棘手的。而且由于代码的复杂性,它不可能包含实际的项目代码,但我在试图使一个更简单的版本准备好在这里显示时想出了问题。