[JavaScript] TanStack Start SDK
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 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.
+1 👍
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 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.
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
Good catch @empotts , @Lms24 fixed this here: https://github.com/getsentry/sentry-javascript/pull/15985
@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?
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.
Tanstack start just went RC
any updates with tanstack start latest version/rc?
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.