I am following angular's best practice in order to make PWA. After making production build (ng built --prod --aot). I am also running from dist on localhost: npm run dev ("dev": "lite-server").
When the browser load I get an error in the console:
Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-EzX1NiGgmo59Hi8wZ/thoAxnVbkTfzIAgnVddwzUO3Y='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
I tried to add to index.html:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' 'unsafe-inline';">
What am I doing wrong?
Please make true like this in router module
RouterModule.forRoot(rootRouterConfig, { useHash: true})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With