Skip to content

[cloudflare] Auto-instrument warns on the TanStack Start tunnel shim of the worker entry #26204

Open

Description

@alexander-zuev

Packages and versions

  • @sentry/cloudflare 11.11.0 (sentryCloudflareVitePlugin)
  • @sentry/tanstackstart-react 11.11.0 (sentryTanstackStart with the managed tunnel)
  • Vite 8.3.6, @cloudflare/vite-plugin, TanStack Start

What happens

In a production build, the Cloudflare auto-instrument plugin warns for every Durable Object and Workflow:

[plugin sentry-cloudflare-auto-instrument] [sentry] Could not auto-instrument AuthSecondaryStorage, CallChargingDO, VoiceAgentSessionDO, PricingActivationWorkflow, RateImportWorkflow.The worker entry has no export matching them. Star re-exports (`export * from "./do"`) are not matched. Export them by name or wrap them manually with corresponding `instrument*WithSentry` helpers.

The worker entry (wrangler.jsonc main: "./src/server.ts") exports each class by name, for example export { CallChargingDO } from "./server/entrypoints/durable-objects/call-charging.do.ts";. The classes are wrapped. The warning is a false positive.

Cause

  1. makeServerEntryTunnelPlugin (tanstackstart-react/build/esm/vite/tunnelRoute.js) loads a shim for the server entry id. The shim is import entry from "<id>?sentry-tunnel-original"; export * from "<id>?sentry-tunnel-original"; export default wrap...(entry).
  2. sentryCloudflareAutoInstrumentPlugin.transform (cloudflare/build/esm/prod/vite/autoInstrument.js) strips ?… from the module id before it compares it with the wrangler main path. So it transforms both the shim and src/server.ts?sentry-tunnel-original.
  3. The real entry gets its classes wrapped. The shim has only export *, so the plugin finds no named class exports and prints the warning.

Without the tunnel plugin (no SENTRY_AUTH_TOKEN in our setup, so sentryTanstackStart is not added), the warning does not appear.

Expected

No warning when the classes are exported by name from the real entry. For example, skip modules whose only exports are export * from the same entry path with a query, or warn only after every module that matches the entry path has been transformed.

Workaround

None needed at runtime; the warning can be ignored.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions