Getting Content Security Policy Error After Deploying React/express App
I deployed a react/express app to heroku and when going to here I get this error 'Refused to load the image 'https://nameless-sands-37753.herokuapp.com/favicon.ico' because it viol
Solution 1:
I had the same problem and it had to do with path.resolve
. I added this at the top of the file:
const path = require('path')
and it worked after that.
Solution 2:
The more general answer to the problem would be to check heroku logs in terminal as follows:
heroku logs -n 500
(choose the number of lines to log) OR
heroku logs --tail
(for live logs, but I found the 1st command to be more effective)
In there you will see the exact error that prevents the app from properly rendering.
Post a Comment for "Getting Content Security Policy Error After Deploying React/express App"