sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

[JavaScript] TanStack Start SDK

Open mydea opened this issue 11 months ago • 11 comments

Description

We already have a router instrumentation for TanStack Router. There is also a @sentry/tanstackstart-react package, that is already released in alpha. Today this package is mostly an empty shell, exposing basic client-side error monitoring by re-exporting @sentry/react. It also includes some empty placeholder implementations, which will be removed as we won't need them.

The goal of this project is to expand @sentry/tanstackstart-react into a full-fledged SDK. This primarily means adding support for server-side error monitoring and improve tracing functionality in the SDK.

In Scope

Currently @sentry/tanstackstart-react provides the following functionality to users:

  • Client-side errors are automatically instrumented.
  • Server-side errors are automatically instrumented for server functions (created with createServerFn).
  • Router instrumentation works using the tanstackRouterBrowserTracingIntegration.

To make this into a full-fledged SDK, we will work on adding better support for error monitoring on the server-side and expand tracing functionality.

Not in Scope

Tanstack Start can either be SolidJS or React based. In this project we will focus on supporting Tanstack Start with React. We might add support for Tanstack Start with SolidJS at a later point in this, but we will not consider this as part of this project.

Tip: React with 👍 to help prioritize this. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

mydea avatar Jan 13 '25 13:01 mydea

@mydea FYI, Start is working on removing the Vinxi deps:

Vinxi will be removed before version 1.0.0 is released and TanStack will rely only on Vite and Nitro. The commands and APIs that use Vinxi will likely be replaced with a Vite plugin or dedicated TanStack Start CLI.

We are looking forward to use Sentry with TanStack Start React.

KiwiKilian avatar Feb 04 '25 07:02 KiwiKilian

+1 👍

nickmanks avatar Feb 10 '25 06:02 nickmanks

Would love some guidance on setting up the source maps properly, too! I can't get this to work with the standard Sentry vite plugin right now:

[plugin vite-plugin-tanstack-start-ensure-global-middleware] Sourcemap is likely to be incorrect: a plugin (vite-plugin-tanstack-start-ensure-global-middleware) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help (x194)

kieranm avatar Mar 02 '25 23:03 kieranm

@kieranm I haven't looked at sourcemaps yet but will write a guide soon. Until then, this particular warning would require fixing upstream in vite-plugin-tanstack-start-ensure-global-middleware. But, I should also note that this is merely a warning and does not indicate that sourcemaps will not work at all.

lforst avatar Mar 03 '25 08:03 lforst

https://github.com/getsentry/sentry-javascript/blob/35e78c66adece2d7a58ec94f5c3f91e996d45b3a/packages/tanstackstart-react/src/config/index.ts#L12

It looks like the authToken is set up incorrectly to be a boolean instead of string

empotts avatar Apr 03 '25 15:04 empotts

Good catch @empotts , @Lms24 fixed this here: https://github.com/getsentry/sentry-javascript/pull/15985

mydea avatar Apr 07 '25 08:04 mydea

@mydea FYI, Start is working on removing the Vinxi deps:

Vinxi will be removed before version 1.0.0 is released and TanStack will rely only on Vite and Nitro. The commands and APIs that use Vinxi will likely be replaced with a Vite plugin or dedicated TanStack Start CLI.

We are looking forward to use Sentry with TanStack Start React.

This is complete now. Does this mean we just this https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/vite?

Gobot1234 avatar Jun 12 '25 14:06 Gobot1234

Hi, @Gobot1234 this was also reaised in https://github.com/getsentry/sentry-javascript/issues/16540. I'd appreciate if you could jump in in the thread and let us know if using the Vite plugin works for you. Bonus points if you could share any special config you had to apply. Due to priorities, we can't take a look at this at the very moment, but it's backlogged.

Lms24 avatar Jun 12 '25 14:06 Lms24

Tanstack start just went RC

nick-potts avatar Sep 24 '25 19:09 nick-potts

any updates with tanstack start latest version/rc?

abielzulio avatar Sep 25 '25 05:09 abielzulio

Hello, as there's an RC now, we'll take another look at this and we'll discuss internally when we're going to start to work on it :)

We will keep you updated in this issue thread.

s1gr1d avatar Sep 26 '25 08:09 s1gr1d