Skip to content

SolidStart v2 support in @sentry/solidstart #23029

Description

@adipascu

Problem Statement

@sentry/solidstart cannot be used with SolidStart v2. The v2 line is at 2.0.0-rc.10 and upstream has just exited changeset pre-mode (solid-start#2279), so a stable release looks close.

v2 drops vinxi for plain Vite plus Nitro v3, and removes app.config.ts entirely. Against @sentry/solidstart@10.69.0 that breaks three ways:

  1. Peer dependency. "@solidjs/start": "^1.0.0", so every v2 install is a peer conflict.
  2. withSentry has nothing to wrap. It takes the v1 app.config.ts object and reaches into solidStartConfig.server, solidStartConfig.vite and server.modules. In v2 solidStart() is an ordinary Vite plugin, there is no server key, and Nitro v3 takes nitro.plugins rather than v2 modules registering a rollup:before hook.
  3. No default export condition. The export map declares only browser and node. On a non-Node server runtime the package fails to resolve at all, so a Cloudflare Workers build cannot even import it.

I noticed #22816 added an optional SolidStart 2 E2E app and its description says the SDK is "very vinxi-oriented" and would need changes. I could not find an issue tracking that work, so this is one to point at.

Solution Brainstorm

  • Widen the @solidjs/start peer range to include ^2.0.0.
  • Replace withSentry with a Vite plugin, since that is the only integration surface v2 offers. The source map and release-injection work withSentry does today would move into it.
  • Register server-side instrumentation as a Nitro v3 plugin under the top-level nitro.plugins key.
  • Add a default condition to the export map so non-Node runtimes resolve.

Additional Context

Point 3 matters beyond Cloudflare. v2's default output targets Nitro presets, several of which are not Node, so the missing default condition will bite more than one deployment target.

For anyone blocked today, @sentry/solid plus @sentry/cloudflare in a hand-written Nitro plugin works on Workers. It gives up the automatic source map upload and server entry instrumentation that withSentry handled, so @sentry/vite-plugin has to be wired up directly and build.sourcemap and nitro.sourcemap both named explicitly, because nitropack v2 used to default the latter and Nitro v3 defaults it off.

Possibly related: #13762 on nitro source maps.

Metadata

Metadata

Assignees

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions