我正在angular2
使用服务器创建客户端应用程序node.js
。客户端应用程序似乎工作得很好,这意味着:
- 我所有的请求都得到了适当的回应。
- 应用程序按预期加载和工作。
但我在终端收到此错误:
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
。
问题是我为什么要面对这个以及如何解决它?