Skip to content

Content-Security-Policy warning #1473

Closed

Description

@cedricr

Hello,

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

Image

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 !

Activity

  1. ssalbdivad commented on Jun 25, 2025

    @ssalbdivad
    Member

    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!

  2. cedricr commented on Jun 26, 2025

    @cedricr
    Author

    Thanks David, I’ll have a look into that!

  3. added 2 commits that reference this issue on Oct 13, 2026
    3127180
    43221b3
  4. ssalbdivad commented on Nov 18, 2026

    @ssalbdivad
    Member

    Fixed in 3.0.0-beta.0 (#1728). Try it with npm i arktype@next.

  5. moved this from To do to Done (merged or closed) in arktypeioon Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done (merged or closed)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions