I am currently working with NextJs@12 and I am attempting to set up CSP for my application. Unfortunately, I keep encountering errors in my console and I cannot figure out where I am going wrong. Below is the current policy that I have in my next.config file.
{
key: "Content-Security-Policy",
value: "default-src 'self' cdn.jsdelivr.net; script-src 'self' https://cdn.jsdelivr.net/npm/@shoelace-style/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="98ebf0f7fdf4f9fbfdd8aab6a8b6a8b5fafdecf9b6acAf">[email protected]</a>/dist/chunks/chunk.HAL7R4WT.js https://embed.tawk.to/_s/v4/app/61adcafd0e1/js/twk-chunk-vendors.js https://js.paystack.co/v1/inline.js https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtm.js 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://eljsuiwhwbb5lp5lmre5eifzuu.appsync-api.us-east-1.amazonaws.com https://embed.tawk.to https://va.tawk.to https://vitals.vercel-insights.com https://vsb75.tawk.to https://vsb89.tawk.to https://www.google-analytics.com wss://eljsuiWhwbb5lp5lmre5eifzuu.appsync-realtime-api.us-East-1.amazonAws.com wss://vsb75.tawk.to wss://vsb89.tawk.to; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://embed.tawk.to https://fonts.googleapis.com; img-src 'self' data: https://embed.tawk.to https://res.cloudinary.com https://tawk.link https://www.google-analytics.com;",
},
So far, I have been encountering this error: https://i.stack.imgur.com/G940Y.png
If anyone could provide assistance in resolving this issue, it would be greatly appreciated. I have been troubleshooting this all day.