NuxtN
Nuxt16mo ago
7 replies
Skruse

Fresh Nuxt3 installation throws Content Security Policy error

I have a fresh nuxt3 installation, nothing modified. But when i run "yarn run dev" on server and open the site in browser i got some errors:

Refused to load the script '../nuxt/dist/app/entry.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I then add the "nuxt-security" module, configure it but this doesnt work as well.

Could maybe someone give me a hint how to configure csp for nuxt3? Or why this isnt working out of the box?

PS: When i run yarn run dev on local machine i can open the site without errors. But if i depoloy it on the server and run there the command, view the page in browser there are the errors.

Thanks for helping
Was this page helpful?