Skip to content

Conversation

@sleepdotexe
Copy link
Contributor

@sleepdotexe sleepdotexe commented Sep 26, 2023

Fixes issue where a freshly cloned example will not work in development mode due to unsafe-eval being blocked by the CSP.

Currently, the example will not work in development. Running the example with run dev will produce EvalError errors in console which prevent the app from functioning. This error also prevents any <Script> components with afterInteractive from being loaded. These issues do not occur in production where eval is not used.

This PR:

  • Fixes the issue by allowing unsafe-eval if the environment is not production.
  • Improves the script-src value by allowing backwards compatibility with browsers that do not support strict-dynamic (https: http: 'unsafe-inline' will be ignored by browsers that support strict-dynamic).

Some further details are available here: #55638. This PR is not a fix for the issue however.

Fixes issue where a freshly cloned example will not work in development mode due to `unsafe-eval` being blocked by the CSP.
@sleepdotexe sleepdotexe requested review from a team as code owners September 26, 2023 07:17
@ijjk ijjk added the examples Issue was opened via the examples template. label Sep 26, 2023
Copy link
Member

@samcx samcx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting a :pr:!

:lgtm:

@samcx samcx enabled auto-merge (squash) March 11, 2024 17:57
@samcx samcx merged commit c703fae into vercel:canary Mar 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

examples Issue was opened via the examples template. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

with-strict-csp example fails with CSP related errors

3 participants