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
{{ message }}
Repository navigation
[WebAssembly] Uno.UI requires 'unsafe-eval' in the page's Content Security Policy #24429
Uno.UI on WebAssembly evaluates JavaScript source strings for part of its interop (WebAssemblyRuntime.InvokeJS and the native dispatcher). Under a Content Security Policy that does not allow 'unsafe-eval' for scripts, the first dispatcher call fails:
fail: Uno.UI.Dispatching.NativeDispatcher[0]
NativeDispatcher unhandled exception
EvalError: Evaluating a string as JavaScript violates the following Content Security Policy directive because 'unsafe-eval' is not an allowed source of script: script-src 'nonce-...' 'self' https://*.vscode-cdn.net 'wasm-unsafe-eval'
and the app then dies with a NullReferenceException in the renderer before drawing anything. 'wasm-unsafe-eval' (required for the .NET runtime) is not sufficient.
Hosts with strict CSPs are increasingly common (VS Code webviews, browser extensions, corporate portals), and the [JSImport]/[JSExport] interop the runtime provides does not need eval. Migrating the remaining string-evaluated interop to generated bindings would let Uno apps run under script-src 'self' 'wasm-unsafe-eval'.
To Reproduce
Publish any Uno WebAssembly app (Skia renderer, Uno.Sdk 6.5.36).
Serve it with Content-Security-Policy: script-src 'self' 'wasm-unsafe-eval' (no 'unsafe-eval').
Open the page: the EvalError above is logged and the app does not render.
The bootstrapper itself boots fine under script-src 'self' 'wasm-unsafe-eval' (as its documentation states); the failure comes from Uno.UI's native dispatcher / WebAssemblyRuntime.InvokeJS path evaluating script strings.
Expected behavior
The app runs without 'unsafe-eval'. If that is not feasible, the requirement should be documented in the WebAssembly hosting docs together with the exact CSP the runtime needs.
Activity
jminnihan commentedon Sep 8, 2026
Same issue for me....had to downgrade to 6.6.42 from 6.7.22. This must be fixed as soon as possible.