Skip to content

fix(tanstackstart-react): remove misleading workerd/worker export conditions#20039

Closed
jmalmo wants to merge 1 commit intogetsentry:developfrom
jmalmo:fix/tanstackstart-react-remove-misleading-worker-exports
Closed

fix(tanstackstart-react): remove misleading workerd/worker export conditions#20039
jmalmo wants to merge 1 commit intogetsentry:developfrom
jmalmo:fix/tanstackstart-react-remove-misleading-worker-exports

Conversation

@jmalmo
Copy link
Copy Markdown

@jmalmo jmalmo commented Mar 30, 2026

Summary

Removes the workerd and worker export conditions from @sentry/tanstackstart-react's package.json. These conditions currently resolve to index.server.js — the same entry as node — which re-exports @sentry/node. This falsely signals Cloudflare Workers compatibility and causes silent Worker crashes when bundlers resolve the workerd condition.

What changed: Deleted the workerd and worker blocks from the "." exports map. Workers bundlers will now fall through to browserindex.client.js (which uses @sentry/browser, safe for Workers).

Caveats (for the team to evaluate):

  • Fallback to browser depends on the bundler's condition set including browser. Adding a default condition pointing to the client entry would be more robust (Node docs), but that's a broader design decision.
  • The browser/client entry does not export wrapFetchWithSentry, so Workers consumers using that import would get a build error. In practice this is an improvement — a build error is far better than the current silent runtime crash.

Longer-term: Proper Workers support would need a dedicated entry using @sentry/cloudflare instead of @sentry/node — multiple server source files (sdk.ts, wrapFetchWithSentry.ts, middleware.ts) import @sentry/node directly, not just the barrel. This is tracked in #18669.

Fixes #20038

References

… conditions (getsentry#20038)

The `workerd` and `worker` export conditions in `package.json` both resolve
to `index.server.js`, which re-exports `@sentry/node`. This falsely signals
Cloudflare Workers compatibility — bundlers targeting Workers resolve the
`workerd` condition and pull the full `@sentry/node` dependency tree
(including OpenTelemetry, undici, and `node:*` built-ins) into the Worker
bundle, causing silent module evaluation failure at runtime.

Remove these conditions so that Workers bundlers fall through to `browser`
(which resolves to `index.client.js` / `@sentry/browser`). This is a
packaging stopgap — proper Workers support would require a dedicated entry
using `@sentry/cloudflare`, tracked in getsentry#18669.
@sdk-maintainer-bot sdk-maintainer-bot bot added issue-already-assigned Used for automated community contribution checks. violating-contribution-guidelines Used for automated community contribution checks. labels Mar 30, 2026
@sdk-maintainer-bot
Copy link
Copy Markdown

This PR has been automatically closed. The referenced issue is already assigned to someone else.

If you believe this assignment is outdated, please comment on the issue to discuss before opening a new PR.

Please review our contributing guidelines for more details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Deps

  • Bump babel-loader from 10.0.0 to 10.1.1 by dependabot in #19997
  • Bump handlebars from 4.7.7 to 4.7.9 by dependabot in #20008

Nuxt

  • Add middleware instrumentation compatibility for Nuxt 5 by s1gr1d in #19968
  • Support parametrized SSR routes in Nuxt 5 by s1gr1d in #19977

Other

  • (browser) Replace element timing spans with metrics by logaretm in #19869
  • (bun) Add bunRuntimeMetricsIntegration by chargome in #19979
  • (core) Support embedding APIs in google-genai by nicohrubec in #19797
  • (node) Add nodeRuntimeMetricsIntegration by chargome in #19923
  • (node-core) Add OTLP integration for node-core/light by andreiborza in #19729
  • (solid) Add route parametrization for Solid Router by andreiborza in #20031

Bug Fixes 🐛

Ci

  • Update validate-pr action to remove draft enforcement by stephanie-anderson in #20037
  • Update validate-pr action to remove draft enforcement by stephanie-anderson in #20035

Other

  • (core) Guard nullish response in supabase PostgREST handler by antonis in #20033
  • (e2e) Pin @opentelemetry/api to 1.9.0 in ts3.8 test app by logaretm in #19992
  • (node) Ensure startNewTrace propagates traceId in OTel environments by logaretm in #19963
  • (nuxt) Use virtual module for Nuxt pages data (SSR route parametrization) by s1gr1d in #20020
  • (opentelemetry) Convert seconds timestamps in span.end() to milliseconds by logaretm in #19958
  • (tanstackstart-react) Remove misleading workerd/worker export conditions by jmalmo in #20039

Documentation 📚

  • (release) Update publishing-a-release.md by nicohrubec in #19982

Internal Changes 🔧

Core

  • Introduce instrumented method registry for AI integrations by nicohrubec in #19981
  • Consolidate getOperationName into one shared utility by nicohrubec in #19971

Deps

  • Bump amqplib from 0.10.7 to 0.10.9 by dependabot in #20000
  • Bump actions/upload-artifact from 6 to 7 by dependabot in #19569
  • Bump srvx from 0.11.12 to 0.11.13 by dependabot in #20001
  • Bump @apollo/server from 5.4.0 to 5.5.0 by dependabot in #20007

Deps Dev

  • Remove esbuild override in astro-5-cf-workers E2E test by isaacs in #20024
  • Bump node-forge from 1.3.2 to 1.4.0 by dependabot in #20012
  • Bump yaml from 2.8.2 to 2.8.3 by dependabot in #19985

Other

  • (deno) Expand Deno E2E test coverage by chargome in #19957
  • (e2e) Add e2e tests for nodeRuntimeMetricsIntegration by chargome in #19989

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

"worker": {
"import": "./build/esm/index.server.js",
"require": "./build/cjs/index.server.js"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix PR lacks test for the regression

Low Severity

This is a fix PR but includes no unit, integration, or E2E test verifying that the regression (silent Worker crashes from the workerd/worker conditions resolving to @sentry/node) is fixed. Per the review rules, fix PRs need at least one test that would have failed before the fix and passes after it — e.g., a test asserting that the "." exports map no longer contains workerd or worker conditions, or an integration test confirming correct resolution for Workers bundlers.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

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

Labels

issue-already-assigned Used for automated community contribution checks. violating-contribution-guidelines Used for automated community contribution checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tanstackstart-react): workerd/worker export conditions resolve to @sentry/node, breaking Cloudflare Workers

1 participant