Skip to content

Auto-instrument the generated Worker entry of Void apps #26945

In progress

Description

@andreiborza

Make sentryCloudflareVitePlugin() work in a native Void app with no extra config.

Problem

  • Void writes the Worker entry to .void/entry.ts and gives the Worker config to @cloudflare/vite-plugin in code. There is no wrangler file with a main.
  • The plugin finds no entry and turns auto-instrumentation off. withSentry does not run, so no data is sent.
  • The plugin looks for instrument.server.* next to the entry. For Void this is .void/, a generated folder that is not in Git.

Scope

  • Detect Void when no wrangler config with a main is found. The Vite config then has plugins with the void: name prefix.
  • Use <root>/.void/entry.ts as the entry. Its default export is class extends WorkerEntrypoint, which the transform wraps already.
  • Read the Durable Object bindings from .void-wrangler.jsonc when the file exists.
  • For Void, look for instrument.server.* in the Vite root.
  • An E2E test app with a native Void app. It checks the route name on the root span, the middleware spans, and an error from a route.

Not in scope

  • Durable Object exports. See the export const sub-issue.
  • Void framework mode (TanStack Start, React Router, SvelteKit, Nuxt, Astro, Analog).

Notes

  • Tested with [email protected] and a shim config that names .void/entry.ts as main. The default export is wrapped, honoIntegration gives GET /api/users/:id root spans and middleware spans, and route errors are sent. This works in vite dev and in the production build.
  • The Worker name and the compatibility date are in void.config.ts, so the plugin cannot read them from a wrangler file.
  • Void needs Node.js 24.22 or later and Vite 8.
  • Open point: a general path for @cloudflare/vite-plugin 2.0 apps that pass the config in code. No public API for the resolved config was found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions