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
I’m getting the following error on the console every time my application starts in Firefox.
Content-Security-Policy: The page’s settings blocked a JavaScript eval (script-src) from being executed because it violates the following directive: “script-src 'nonce-####=='” (Missing 'unsafe-eval')
Chrome is more verbose, but the gist is the same
I see that it was discussed here : #955,
and that it is a harmless message (being a the result of a check to see if JIT can be enabled), but it’s quite unsettling having an error displaying in the console, harmless or not 😅.
I would expect the "jitless: true" configuration option to bypass this test, but it’s apparently not the case (at least I couln’t make it work). Would it be possible to make it so ? That would be good enough for me 🙂
Still, I’m wondering if I’m missing something: as the Chrome message indicates, a strong CSP configuration really is a must-have (at least in client code), so I’m a bit surprised I’m the first one complaining about it ?
Thanks for looking into it, and for all your work on this wonderful library !
I will try and tackle this at some point, but if you're able to take a look so that the current behavior is maintained while avoiding that unnecessary warning, that would be a huge help!
Activity
ssalbdivad commentedon Jun 25, 2025
Thanks for letting me know about this!
The key should be to avoid evaluating
envHasCsp()when the defaults are initialized here:https://github.com/arktypeio/arktype/blob/depth-nodes/ark/schema/kinds.ts#L92-L93
I will try and tackle this at some point, but if you're able to take a look so that the current behavior is maintained while avoiding that unnecessary warning, that would be a huge help!
cedricr commentedon Jun 26, 2025
Thanks David, I’ll have a look into that!
fix(schema): skip the CSP probe when jitless is configured
chore(docs): regenerate the util declarations and llms.txt
ssalbdivad commentedon Nov 18, 2026
Fixed in 3.0.0-beta.0 (#1728). Try it with
npm i arktype@next.