What would be the steps to resolve this error?
ERROR in HostResourceResolver: could not resolve styles.css in context of C:/Users/shema/Desktop/angular/RP/ResourcePlanning/src/app/addproject/addproject.component.ts)
HostResourceResolver
happens when the name of your component is wrong.
form.component.html
Wrong name, need to correct for form-dialog.component.html
to resolve.
and my templateUrl is form-dialog.component.html.
@Component({
selector: 'app-form-dialog',
templateUrl: './form-dialog.component.html',
styleUrls: ['./form-dialog.component.scss']
})
export class FormDialogComponent implements OnInit {}
For anyone facing this issue: it could be a number of reasons but usually it is because the file cannot be read by the angular compiler or there is a syntax error.
For me, I was including a typescript only component within the HTML of another component (the app component) but had a templateUrl
property mentioned with a blank value.
This breaks the build process - but does not mention any file name.
I fixed the issue by replacing templateUrl
with template
.
Please show the component code, especially @Component
part. Typically you would have something like this:
@Component({
selector: 'app-add-project',
templateUrl: './add-project.component.html',
styleUrls: ['styles.css']
})
export class AddProjectComponent implements OnInit {
....
It looks like Angular cannot resolve styles.css
. You probably need to specify relative path to the file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With