When i execute ionic serve command in terminal. It genterates the following error:
Refused to load the image ‘http://localhost:8101/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.
localhost/:1 Failed to load resource: the server responded with a status of 404 (Not Found)
I have tried many ways for solving, but i did not have could. Please help
You can add this line in your index.html file. This file locate in src folder.
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
And create assets->icon folder in your src folder and put favicon.ico icon..
When I had this error, it was really because I didn’t import a library into a *.ts file — this error message was completely unrelated to the actual bug in my case.
I had the exact same problem. I advise you to take a look at your Terminal in VSCode (or the standard terminal if you launched it by there) and look for an ERROR message.
Most likely the problem isn’t the favicon.ico blabla stuff but another element of your app, something in a .ts doc for example. Via Terminal you can seek for it in a better way than Chrome, that shows you this unrelated message.