I encountered this specific error message:
Error: Anticipated 'styles' to be a collection of strings.
Despite the fact that I have clearly defined the styles as an array of strings:
styleUrls: ['./app.component.css']
Can anyone pinpoint what mistake I might be making?
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h2 class="float-left">Hey</h2>`,
styleUrls: ['./app.component.css']
})
export class AppComponent { }
app.component.css
.float-left {
float: left;
}
Excerpt from webpack.common.js
module: {
rules: [{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader']
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/,
loader: 'css-loader'
}]
},