Skip to content

Conversation

@timneutkens
Copy link
Member

@timneutkens timneutkens commented Jan 12, 2026

What

Fixes the CSP documentation "Without Nonces" example to only include 'unsafe-eval' in development mode.

Why

The example was showing 'unsafe-eval' without a development check, which would cause it to be shipped to production. This is inconsistent with the guidance in the "Development vs Production Considerations" section which correctly shows how to conditionally add 'unsafe-eval' only in development.

How

Added a isDev check using process.env.NODE_ENV === 'development' and conditionally includes 'unsafe-eval' in the script-src directive only when in development mode.

@nextjs-bot nextjs-bot added created-by: Turbopack team PRs by the Turbopack team. Documentation Related to Next.js' official documentation. labels Jan 12, 2026
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@timneutkens timneutkens marked this pull request as ready for review January 12, 2026 08:39
@timneutkens timneutkens merged commit ec11c86 into canary Jan 12, 2026
75 checks passed
@timneutkens timneutkens deleted the fix-csp-docs-unsafe-eval branch January 12, 2026 09:13
Copy link

@alimercan985-bit alimercan985-bit left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Turbopack team PRs by the Turbopack team. Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants