disclaimer: Yes, I saw that there are more "The template specified for component AppComponent is not a string" related questions but none of them describes the specific problem I'm experiencing.
I get this runtime error when I compile without AoT in ng build:
Uncaught Error: The template specified for component AppComponent is not a string
This error actually make sense because in the generated bundled code (main.ts) I see:
template: __webpack_require__(/*! raw-loader!./app.component.html */ "../node_modules/raw-loader/dist/cjs.js!../Scripts/app/app.component.html"),
while in a new Angular app I see:
template: __webpack_require__(/*! ./app.component.html */ "./src/app/app.component.html")
Somehow the raw-loader gets added as a loader to my .html files.
Now maybe it's important to mention that i'm migrating my webpack 4 AngularJs project to Angular 8. BUT When I debug my webpack build I see no rule that its test contains .html and a loader. that contains raw-loader.
So my loaders rules doesn't affect this raw-loader addition to app.component.html
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
}
app.component.html:
<div></div>
I'll appreciate any help, thanks.
AppComponent.ts
– Syncopation