Angular 7 “expected 'styles' to be an array of strings”

前端 未结 6 1782
借酒劲吻你
借酒劲吻你 2021-01-07 23:53

I am trying to run my server and have my app.component.html load on localhost:8000. Instead, I am receiving this error

compiler.js:7992 Uncaught Error

6条回答
  •  情歌与酒
    2021-01-08 00:27

    I had the same console error, spent a few days reading every hit on Google...

    Solved!

    The story: I had to add functionality to an existing Angular project. When I performed git clone, ng serve, open browser -> error assert....

    I decided to upgrade to Angular 8 and see if the problem goes away, and it didn't. Eventually, I created a new Angular 8 app using "ng new ..."

    Compared package.json and angular.json of both existing and new project. I found out, the brand new Angular app, had no loader packages In package.json, while the existing did have. Also the existing project was specifying a webpack devDependancy, i removed all loaders, and webpack, deleted package-lock.json and node_modules folder -> npm install.

    Solved. I guess there is some bit of code that was being forced to a specific version, conflicting with what Angular really needs.

提交回复
热议问题