Skip to content

EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive #1861

Closed

Description

@elangoRamar

I am trying to use alasql in an browser environment, when i try to load the script which has alasql bundled within it is giving

EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive

Based on content security policy we can't use those JS functions mentioned in this link

It seems alasql is using new Function() which triggers the CSP error. how can we resolve this?

Activity

  1. mathiasrw commented on Jan 23, 2024

    @mathiasrw
    Member

    AlaSQL is built around creating code. for new functions. If you are not allowed to create new functions then AlaSQL cant help you (until we made a version that preprocesses the functions as part of the build step - but we are not there yet)

  2. githorse commented on Feb 19, 2024

    @githorse

    Duplicates #1482, #1489, and #1667.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions