'React-google-chart throws Content Security Policy issue
React-google-chart works well in development but it throws below error after build deployed in server.
VM565 2.351f67d9.chunk.js:2 Refused to load the script 'https://www.gstatic.com/charts/loader.js' because it violates the following Content Security Policy directive: "script-src 'self' https://ssl.google-analytics.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
I have tried
"content_security_policy": "script-src 'self' https://maps.googleapis.com https://maps.gstatic.com; object-src 'self'"
in manifest file
and
<meta http-equiv="Content-Security-Policy"
content="default-src 'self' data: gap: ws: ;
style-src 'self' https: *.google-analytics.com;
script-src 'self' https: *.google-analytics.com;
media-src 'none';
font-src *;
connect-src *;
img-src 'self' data: content: https: *.google-analytics.com;">
in index.html file
but none worked. May i know what i missing ? thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|