Minimal reproduction for getsentry/sentry-javascript#20038.
@sentry/[email protected] has workerd and worker export conditions that resolve to index.server.js, which does export * from '@sentry/node'. When bundled for Cloudflare Workers (Nitro cloudflare-module preset, noExternals: true), this pulls @sentry/node + its full dependency tree into the Worker bundle, causing a runtime crash: Error: No such module "node:fs".
bun install
bun run build
bun run preview
# Visit http://localhost:8787 → HTTP 500
# Wrangler logs: Error: No such module "node:fs", imported from router chunk| Config | Router chunk | wrangler dev |
HTTP |
|---|---|---|---|
| No Sentry | 25 KiB | Works | 200 |
@sentry/tanstackstart-react |
1,324 KiB | No such module "node:fs" |
500 |
@sentry/react |
183 KiB | Works | 200 |
Comment out the Sentry import in src/router.tsx:
-import * as Sentry from '@sentry/tanstackstart-react'
+// import * as Sentry from '@sentry/tanstackstart-react'(Also comment out the Sentry.init(...) block.)
bun run build && bun run preview
# Visit http://localhost:8787 → HTTP 200 ✅-import * as Sentry from '@sentry/tanstackstart-react'
+import * as Sentry from '@sentry/react'bun run build && bun run preview
# Visit http://localhost:8787 → HTTP 200 ✅bun run build:analyzeShows the @sentry/node artifacts (node:http, node:os, node:fs, undici, @opentelemetry/instrumentation) in the Worker bundle.
vite.config.ts— Nitrocloudflare-modulepreset,noExternals: truesrc/router.tsx— imports@sentry/tanstackstart-react(the crash trigger)scripts/check-bundle.js— post-build bundle analysis
| Dependency | Version |
|---|---|
@sentry/tanstackstart-react |
^10.46.0 |
@tanstack/react-start |
~1.166.1 |
@tanstack/react-router |
~1.163.3 |
nitro |
~3.0.260311-beta |
vite |
rolldown-vite ^7.3.1 |
wrangler |
^4.0.0 |
| Cloudflare Workers | nodejs_compat, compat date 2025-09-01 |