Compile error: violates the following Content Security Policy directive

Hi There

I am getting a strange error on ionic serve: Failed to compile
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.

The last command I ran before this error occurred was:

$ ionic cordova resources android

Could this have caused the issue?

This is a new ionic4 cordova project.
No changes have been made to the default index.html or angular.json generated by the CLI

Any ideas on how to resolve this issue?

1 Like

I had the same problem and it was due to a routing problem “ERROR in Could not resolve module … to …module.ts”.

So this error message in the browser console actually didn’t have anything to do with the real problem, which was that I didn’t set the path right of one of my child modules. Check your terminal if you might have an error showing up adn try to resolve that error.

1 Like

Thanks…it worked when i cleared all errors in terminal