The selector “my-app” did not match any elements

前端 未结 12 1152
逝去的感伤
逝去的感伤 2020-12-07 18:15

The problem is when I run my app, it works fine. But when I refresh it, most of the time I get below msg.

The selector \"my-app\" did not match any e

12条回答
  •  醉酒成梦
    2020-12-07 18:59

    I got same issue when I use Angular Universal. But it is because I am using BrowserModule in main.node.ts, the solution is

      imports: [
        UniversalModule,
        BrowserModule   // <- delete this will solve the issue
      ],
    

    And check here for more info: https://github.com/angular/universal/issues/542

提交回复
热议问题