Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Client-side
process.envunavailable in Vite bundle- Replaced
process.env.SENTRY_DSNwithimport.meta.env.VITE_SENTRY_DSNin the client entrypoint and updated the repro instructions to use the Vite-prefixed variable.
- Replaced
- ✅ Fixed: Generated
.react-router/typesfiles committed to repository- Removed the committed generated
.react-router/typesfiles and addedsentry-javascript/19580/.gitignorewith.react-router/to keep them out of version control.
- Removed the committed generated
Or push these changes by commenting:
@cursor push 137bc694e2
Preview (137bc694e2)
diff --git a/sentry-javascript/19580/.gitignore b/sentry-javascript/19580/.gitignore
new file mode 100644
--- /dev/null
+++ b/sentry-javascript/19580/.gitignore
@@ -1,0 +1 @@
+.react-router/
diff --git a/sentry-javascript/19580/.react-router/types/+future.ts b/sentry-javascript/19580/.react-router/types/+future.ts
deleted file mode 100644
--- a/sentry-javascript/19580/.react-router/types/+future.ts
+++ /dev/null
@@ -1,9 +1,0 @@
-// Generated by React Router
-
-import "react-router";
-
-declare module "react-router" {
- interface Future {
- v8_middleware: false
- }
-}
\ No newline at end of file
diff --git a/sentry-javascript/19580/.react-router/types/+routes.ts b/sentry-javascript/19580/.react-router/types/+routes.ts
deleted file mode 100644
--- a/sentry-javascript/19580/.react-router/types/+routes.ts
+++ /dev/null
@@ -1,43 +1,0 @@
-// Generated by React Router
-
-import "react-router"
-
-declare module "react-router" {
- interface Register {
- pages: Pages
- routeFiles: RouteFiles
- routeModules: RouteModules
- }
-}
-
-type Pages = {
- "/": {
- params: {};
- };
- "/items/:id": {
- params: {
- "id": string;
- };
- };
-};
-
-type RouteFiles = {
- "root.tsx": {
- id: "root";
- page: "/" | "/items/:id";
- };
- "routes/home.tsx": {
- id: "routes/home";
- page: "/";
- };
- "routes/items.$id.tsx": {
- id: "routes/items.$id";
- page: "/items/:id";
- };
-};
-
-type RouteModules = {
- "root": typeof import("./app/root.tsx");
- "routes/home": typeof import("./app/routes/home.tsx");
- "routes/items.$id": typeof import("./app/routes/items.$id.tsx");
-};
\ No newline at end of file
diff --git a/sentry-javascript/19580/.react-router/types/+server-build.d.ts b/sentry-javascript/19580/.react-router/types/+server-build.d.ts
deleted file mode 100644
--- a/sentry-javascript/19580/.react-router/types/+server-build.d.ts
+++ /dev/null
@@ -1,18 +1,0 @@
-// Generated by React Router
-
-declare module "virtual:react-router/server-build" {
- import { ServerBuild } from "react-router";
- export const assets: ServerBuild["assets"];
- export const assetsBuildDirectory: ServerBuild["assetsBuildDirectory"];
- export const basename: ServerBuild["basename"];
- export const entry: ServerBuild["entry"];
- export const future: ServerBuild["future"];
- export const isSpaMode: ServerBuild["isSpaMode"];
- export const prerender: ServerBuild["prerender"];
- export const publicPath: ServerBuild["publicPath"];
- export const routeDiscovery: ServerBuild["routeDiscovery"];
- export const routes: ServerBuild["routes"];
- export const ssr: ServerBuild["ssr"];
- export const allowedActionOrigins: ServerBuild["allowedActionOrigins"];
- export const unstable_getCriticalCss: ServerBuild["unstable_getCriticalCss"];
-}
\ No newline at end of file
diff --git a/sentry-javascript/19580/.react-router/types/app/+types/root.ts b/sentry-javascript/19580/.react-router/types/app/+types/root.ts
deleted file mode 100644
--- a/sentry-javascript/19580/.react-router/types/app/+types/root.ts
+++ /dev/null
@@ -1,59 +1,0 @@
-// Generated by React Router
-
-import type { GetInfo, GetAnnotations } from "react-router/internal";
-
-type Module = typeof import("../root.js")
-
-type Info = GetInfo<{
- file: "root.tsx",
- module: Module
-}>
-
-type Matches = [{
- id: "root";
- module: typeof import("../root.js");
-}];
-
-type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
-
-export namespace Route {
- // links
- export type LinkDescriptors = Annotations["LinkDescriptors"];
- export type LinksFunction = Annotations["LinksFunction"];
-
- // meta
- export type MetaArgs = Annotations["MetaArgs"];
- export type MetaDescriptors = Annotations["MetaDescriptors"];
- export type MetaFunction = Annotations["MetaFunction"];
-
- // headers
- export type HeadersArgs = Annotations["HeadersArgs"];
- export type HeadersFunction = Annotations["HeadersFunction"];
-
- // middleware
- export type MiddlewareFunction = Annotations["MiddlewareFunction"];
-
- // clientMiddleware
- export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
-
- // loader
- export type LoaderArgs = Annotations["LoaderArgs"];
-
- // clientLoader
- export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
-
- // action
- export type ActionArgs = Annotations["ActionArgs"];
-
- // clientAction
- export type ClientActionArgs = Annotations["ClientActionArgs"];
-
- // HydrateFallback
- export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
-
- // Component
- export type ComponentProps = Annotations["ComponentProps"];
-
- // ErrorBoundary
- export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
-}
\ No newline at end of file
diff --git a/sentry-javascript/19580/.react-router/types/app/routes/+types/home.ts b/sentry-javascript/19580/.react-router/types/app/routes/+types/home.ts
deleted file mode 100644
--- a/sentry-javascript/19580/.react-router/types/app/routes/+types/home.ts
+++ /dev/null
@@ -1,62 +1,0 @@
-// Generated by React Router
-
-import type { GetInfo, GetAnnotations } from "react-router/internal";
-
-type Module = typeof import("../home.js")
-
-type Info = GetInfo<{
- file: "routes/home.tsx",
- module: Module
-}>
-
-type Matches = [{
- id: "root";
- module: typeof import("../../root.js");
-}, {
- id: "routes/home";
- module: typeof import("../home.js");
-}];
-
-type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
-
-export namespace Route {
- // links
- export type LinkDescriptors = Annotations["LinkDescriptors"];
- export type LinksFunction = Annotations["LinksFunction"];
-
- // meta
- export type MetaArgs = Annotations["MetaArgs"];
- export type MetaDescriptors = Annotations["MetaDescriptors"];
- export type MetaFunction = Annotations["MetaFunction"];
-
- // headers
- export type HeadersArgs = Annotations["HeadersArgs"];
- export type HeadersFunction = Annotations["HeadersFunction"];
-
- // middleware
- export type MiddlewareFunction = Annotations["MiddlewareFunction"];
-
- // clientMiddleware
- export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
-
- // loader
- export type LoaderArgs = Annotations["LoaderArgs"];
-
- // clientLoader
- export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
-
- // action
- export type ActionArgs = Annotations["ActionArgs"];
-
- // clientAction
- export type ClientActionArgs = Annotations["ClientActionArgs"];
-
- // HydrateFallback
- export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
-
- // Component
- export type ComponentProps = Annotations["ComponentProps"];
-
- // ErrorBoundary
- export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
-}
\ No newline at end of file
diff --git a/sentry-javascript/19580/.react-router/types/app/routes/+types/items.$id.ts b/sentry-javascript/19580/.react-router/types/app/routes/+types/items.$id.ts
deleted file mode 100644
--- a/sentry-javascript/19580/.react-router/types/app/routes/+types/items.$id.ts
+++ /dev/null
@@ -1,62 +1,0 @@
-// Generated by React Router
-
-import type { GetInfo, GetAnnotations } from "react-router/internal";
-
-type Module = typeof import("../items.$id.js")
-
-type Info = GetInfo<{
- file: "routes/items.$id.tsx",
- module: Module
-}>
-
-type Matches = [{
- id: "root";
- module: typeof import("../../root.js");
-}, {
- id: "routes/items.$id";
- module: typeof import("../items.$id.js");
-}];
-
-type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
-
-export namespace Route {
- // links
- export type LinkDescriptors = Annotations["LinkDescriptors"];
- export type LinksFunction = Annotations["LinksFunction"];
-
- // meta
- export type MetaArgs = Annotations["MetaArgs"];
- export type MetaDescriptors = Annotations["MetaDescriptors"];
- export type MetaFunction = Annotations["MetaFunction"];
-
- // headers
- export type HeadersArgs = Annotations["HeadersArgs"];
- export type HeadersFunction = Annotations["HeadersFunction"];
-
- // middleware
- export type MiddlewareFunction = Annotations["MiddlewareFunction"];
-
- // clientMiddleware
- export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
-
- // loader
- export type LoaderArgs = Annotations["LoaderArgs"];
-
- // clientLoader
- export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
-
- // action
- export type ActionArgs = Annotations["ActionArgs"];
-
- // clientAction
- export type ClientActionArgs = Annotations["ClientActionArgs"];
-
- // HydrateFallback
- export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
-
- // Component
- export type ComponentProps = Annotations["ComponentProps"];
-
- // ErrorBoundary
- export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
-}
\ No newline at end of file
diff --git a/sentry-javascript/19580/README.md b/sentry-javascript/19580/README.md
--- a/sentry-javascript/19580/README.md
+++ b/sentry-javascript/19580/README.md
@@ -16,7 +16,7 @@
1. Set your Sentry DSN:
```bash
- export SENTRY_DSN=<your-dsn>
+ export VITE_SENTRY_DSN=<your-dsn>
```
2. Install dependencies:
diff --git a/sentry-javascript/19580/app/entry.client.tsx b/sentry-javascript/19580/app/entry.client.tsx
--- a/sentry-javascript/19580/app/entry.client.tsx
+++ b/sentry-javascript/19580/app/entry.client.tsx
@@ -4,7 +4,7 @@
import { HydratedRouter } from "react-router/dom";
Sentry.init({
- dsn: process.env.SENTRY_DSN || "",
+ dsn: import.meta.env.VITE_SENTRY_DSN || "",
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
debug: true, // Enable debug to see transaction names in console| import { HydratedRouter } from "react-router/dom"; | ||
|
|
||
| Sentry.init({ | ||
| dsn: process.env.SENTRY_DSN || "", |
There was a problem hiding this comment.
Client-side process.env unavailable in Vite bundle
High Severity
process.env.SENTRY_DSN is not available in Vite client-side bundles. Vite only exposes env variables prefixed with VITE_ via import.meta.env, and does not define a global process object in the browser. This will cause a ReferenceError: process is not defined at runtime, preventing Sentry from initializing on the client — which means the browserTracingIntegration never activates and the reproduction cannot actually demonstrate the [object Object] transaction name bug it was created for.
| interface Future { | ||
| v8_middleware: false | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Generated .react-router/types files committed to repository
Low Severity
The .react-router/types/ directory contains auto-generated files (marked // Generated by React Router) that React Router's documentation explicitly says to add to .gitignore. These files are regenerated on every dev/build run and aren't meant to be version-controlled. A .gitignore file with .react-router/ is missing from the reproduction.
Additional Locations (2)
- Use reactRouterTracingIntegration() instead of browserTracingIntegration() - Use createSentryHandleRequest/createSentryHandleError in entry.server.tsx - Add instrument.server.mjs with NODE_OPTIONS for server-side init Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>



Summary
reactRouterTracingIntegrationproduces[object Object]as transaction name when navigating with an objecttoprop@sentry/react-routerintegrationto(works correctly) and one with an objectto(shows the bug)How to run
Click the object-based Link and observe the transaction name
[object Object]in Sentry.🤖 Generated with Claude Code