Skip to content

feat(cloudflare)!: Make the nodejs_compat entrypoint the default - #22900

Open
JPeer264 wants to merge 1 commit into
jp/remove-oxlint-settingsfrom
jp/node-compat-cloudflare
Open

feat(cloudflare)!: Make the nodejs_compat entrypoint the default#22900
JPeer264 wants to merge 1 commit into
jp/remove-oxlint-settingsfrom
jp/node-compat-cloudflare

Conversation

@JPeer264

Copy link
Copy Markdown
Member

This PR moves the capabilities of the /nodejs_compat entrypoint to the default entrypoint and removes the entrypoint entirely.

On top I removed all als specific tests, as they're not relevant anymore.

@JPeer264 JPeer264 self-assigned this Jul 31, 2026
@JPeer264
JPeer264 force-pushed the jp/node-compat-cloudflare branch from 7397a23 to 6397b2e Compare July 31, 2026 08:14
@JPeer264
JPeer264 force-pushed the jp/node-compat-cloudflare branch from 6397b2e to 8631715 Compare July 31, 2026 08:16
@JPeer264
JPeer264 marked this pull request as ready for review July 31, 2026 08:25
@JPeer264
JPeer264 requested a review from a team as a code owner July 31, 2026 08:25
@JPeer264
JPeer264 requested review from andreiborza, isaacs and nicohrubec and removed request for a team July 31, 2026 08:25
Comment on lines +13 to +23
import { vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';

const _vercelAIIntegration = ((options: VercelAiOptions = {}) => {
return {
name: INTEGRATION_NAME,
const inner = vercelAiIntegration(options);

return extendIntegration(inner, {
options,
setup(client) {
addVercelAiProcessors(client);
},
};
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Importing vercelAIIntegration from the main entrypoint will cause a startup crash in Cloudflare Workers environments that do not have the nodejs_compat flag enabled.
Severity: HIGH

Suggested Fix

Revert the change that exports vercelAIIntegration from the main entrypoint (packages/cloudflare/src/index.ts). This integration and its Node.js-specific dependencies should be isolated in a separate entrypoint, such as the previously used @sentry/cloudflare/nodejs_compat, to prevent breaking users on runtimes without Node.js compatibility.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/cloudflare/src/integrations/tracing/vercelai.ts#L13-L23

Potential issue: The `vercelAIIntegration` is now exported from the main
`@sentry/cloudflare` package entrypoint. This integration depends on
`@sentry/server-utils`, which imports the Node.js-specific module
`node:diagnostics_channel` at the top level. Consequently, any user attempting to import
`vercelAIIntegration` in a Cloudflare Worker environment without the `nodejs_compat`
compatibility flag will experience a startup failure. The worker will fail to load
because it cannot resolve the `node:` module, which is a known constraint for certain
runtimes like Shopify Oxygen. This change violates an explicit architectural rule
designed to keep the main package entrypoint free of Node.js dependencies.

Also affects:

  • packages/cloudflare/src/index.ts:132

Did we get this right? 👍 / 👎 to inform future reviews.

@JPeer264 JPeer264 changed the title ref(cloudflare): Ensure wrapRequestHandler stays free of node specifcs feat(cloudflare)!: Make the nodejs_compat entrypoint the default Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 47.08 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.09 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.82 kB - -
@sentry/browser (incl. Tracing, Replay) 86.39 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.11 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB - -
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.6 kB - -
@sentry/react (incl. Tracing) 49.33 kB - -
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 49.05 kB - -
@sentry/svelte 29.85 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 47.45 kB - -
CDN Bundle (incl. Logs, Metrics) 33.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.08 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB - -
CDN Bundle - uncompressed 95.04 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.27 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.25 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.51 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.18 kB - -
@sentry/nextjs (client) 51.92 kB - -
@sentry/sveltekit (client) 47.51 kB - -
@sentry/core/server 79.6 kB - -
@sentry/core/browser 51.7 kB - -
@sentry/node 121.35 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.88 kB -0.01% -1 B 🔽
@sentry/aws-serverless 93.16 kB - -
@sentry/cloudflare (withSentry) - minified 198.36 kB +0.08% +158 B 🔺
@sentry/cloudflare (withSentry) 488.03 kB +0.13% +599 B 🔺

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/node-compat-cloudflare branch from 8631715 to dcac51d Compare July 31, 2026 08:32
@JPeer264
JPeer264 requested a review from a team as a code owner July 31, 2026 10:17
@JPeer264
JPeer264 requested review from s1gr1d and removed request for a team July 31, 2026 10:17
@JPeer264
JPeer264 force-pushed the jp/node-compat-cloudflare branch from dcac51d to 0a6bcec Compare July 31, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant