You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lauch dev-server and open Chrome, naive-ui is not work and errors in console:
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-12345'". Either the 'unsafe-inline' keyword, a hash ('sha256-fZjflqFcROvJ0PG4AlqR1f+YzoVYVuh3bUA02kwtbIw='), or a nonce ('nonce-...') is required to enable inline execution.
描述错误
当对应用有安全性需求的时候,CSP不允许使用unsafe-inline。
在vite5中可以通过配置 html.cspNonce 给页面所有script和style加上Nonce满足CSP的要求。
但naiveUI似乎并不适用,打开页面后控制台报错,且UI库的组件均无法正常使用。
复现步骤
最小复现链接
https://github.com/linwh203/csp-naive
系统信息
使用的包管理器
npm
验证
The text was updated successfully, but these errors were encountered: