Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unsafe-eval during development #55998

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Allow unsafe-eval during development #55998

merged 3 commits into from
Mar 11, 2024

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/PR related to examples 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
28 checks passed
@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/PR related to examples 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