Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refused to load the image because it violates the following Content Security Policy directive (favicon)

Tags:

angular

When I start the server I get the following error:

Refused to load the image 'http://localhost:4200/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

I haven't changed the favicon or anything, it's all by default.

like image 666
wizzzO Avatar asked Jun 04 '19 09:06

wizzzO


1 Answers

I came here to find an answer to the same question but I solved it myself. I had an angular compilation error in my app (I hadn't run ng build) and the error above was masking this problem. I had missed some properties on an object I was using in a resolver.

I'm running Angular ~7.x

like image 67
JWallace Avatar answered Oct 02 '22 11:10

JWallace