Strange ERROR in HostResourceLoader: when run ng build, ng build --prod or ng serve

て烟熏妆下的殇ゞ 提交于 2020-01-15 09:30:03

问题


I'm creating an app with angular 6 but I facing a strange error when I try to run any build command: 1- ng build 2- ng build --prod 3- ng build serve

Error:ERROR in HostResourceLoader: loader(F:/Spark/Spark Apps Development/doPayroll Front-End/doPayroll Front-End/src/app/getstarted/getstarted.component.html) returned a Promise

Also, the error show on the following image

It's strange that the error solve and the app run when I press ctrl+s to any ts file, it resume compiling and run successfully at the end.

But now I need to deploy my app and now I facing this issue in the cloud.

So please if any one can help, this proplem takes from me more than it deserves.

Update

getstarted.component.html

<app-firstheader></app-firstheader>

<br>
<div class="main">
    <div class="welcome">
        <p [translate]="'getstarted.title'">
        </p>
    </div>
    <hr class="underline">
    <img width="300" src="assets/img/welcome.png">
    <p class="welcome2" [translate]="'getstarted.body'"></p>
    <button (click)="next()" class="button button4" [translate]="'getstarted.next'"></button>
</div>
<br>

<app-footer></app-footer>

getstarted.component.ts

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';

@Component({
  selector: 'getstarted',
  templateUrl: './getstarted.component.html',
  styleUrls: ['./getstarted.component.css']
})
export class GetstartedComponent implements OnInit {


  constructor(private router: Router) {}

  next(){
    this.router.navigate(['/presignup']);
  }

  ngOnInit() {
  }

}

Thanks in advance.

来源:https://stackoverflow.com/questions/59023289/strange-error-in-hostresourceloader-when-run-ng-build-ng-build-prod-or-ng-se

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!