Laravel CSP how to allow inline styles in laravel-mix webpack

Viewed 15

I am using spatie/laravel-csp package to set CSP headers on laravel application. But the inline style could not be applied and refused with the following error.

Refused to apply inline style because it violates the following Content Security Policy
directive: "style-src 'self' 'nonce-TjpZGox5zGathTvJDeVMfxzHaOtWMc7v' 'unsafe-inline'".

further detail.

  1. I am using laravel 7.
  2. /spatie/laravel-csp 2.8
  3. "laravel-mix": "^5.0.1",
  4. and inertia with Vue 2

What i have try so far.

  1. specify webpack_nonce @ entry file (main.js) webpack documentation
  2. Using inline scripts and styles as in spatie/laravel-csp documentation
0 Answers
Related