Angular 7 "expected 'styles' to be an array of strings"
I got this as well in the process of upgrading to Angular 7 and upgrading various dependencies to their latest versions. I found that using raw-loader version 2.0.0 was causing this error even though my styleUrls were correct syntax. Downgrading to raw-loader version 1.0.0 resolved this issue. I don't know if this helps in your situation.
Stylesheets which are referenced in your angular.json
's styles[]
cannot be referenced in a Component's styleUrls[]
decorator.
Make sure that you are not referencing ./app.component.css
in both files.
In my case, it happened because in the multi-repo project the incorrect loader has been used during the Angular build process (raw-loader@2
), so I had to add the correct loader to Angular project dependencies:
devDependencies: {
...
raw-loader: "^1.0.0"
}