Skip to content

Conversation

@nicohrubec
Copy link
Member

@nicohrubec nicohrubec commented Nov 26, 2025

Just cleaning up, we won't be needing any of these. I am aware this is breaking, but I think it's fine since we are still in alpha and these are empty anyways.

@nicohrubec nicohrubec changed the title chore(tanstack): Remove empty placeholder implementations chore(tanstackstart-react): Remove empty placeholder implementations Nov 26, 2025
@nicohrubec nicohrubec self-assigned this Nov 26, 2025
@nicohrubec nicohrubec marked this pull request as ready for review November 27, 2025 08:29
Comment on lines 16 to 21
return props.children;
};

/**
* A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
*/
export function createReduxEnhancer() {
return (createStore: unknown) => createStore;
}

/**
* A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
* SSR errors so they should simply be a passthrough.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: createReduxEnhancer() and showReportDialog() are declared in types but are undefined at runtime on the server, causing TypeError.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The PR removes createReduxEnhancer() and showReportDialog() from packages/tanstackstart-react/src/server/index.ts. However, their type declarations persist in packages/tanstackstart-react/src/index.types.ts. This allows TypeScript to permit calls to Sentry.createReduxEnhancer() and Sentry.showReportDialog() on the server. At runtime, these functions are undefined because they are no longer exported, leading to a TypeError: ... is not a function if invoked.

💡 Suggested Fix

Remove or update the type declarations for createReduxEnhancer() and showReportDialog() in packages/tanstackstart-react/src/index.types.ts to align with their removal from server/index.ts.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/tanstackstart-react/src/server/index.ts#L16-L21

Potential issue: The PR removes `createReduxEnhancer()` and `showReportDialog()` from
`packages/tanstackstart-react/src/server/index.ts`. However, their type declarations
persist in `packages/tanstackstart-react/src/index.types.ts`. This allows TypeScript to
permit calls to `Sentry.createReduxEnhancer()` and `Sentry.showReportDialog()` on the
server. At runtime, these functions are `undefined` because they are no longer exported,
leading to a `TypeError: ... is not a function` if invoked.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 3982457

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Breaking change: removed publicly exported server-side functions (Bugbot Rules)

Flagging this because the review rules mention to flag removal of publicly exported functions. The createReduxEnhancer and showReportDialog functions are removed from the server module, but they're still declared as exports in index.types.ts. Since @sentry/node doesn't export these functions, isomorphic code importing them from @sentry/tanstackstart-react will get runtime errors on the server while TypeScript indicates they exist. The previous passthrough implementations allowed these functions to be safely called in code running on both client and server.

packages/tanstackstart-react/src/server/index.ts#L17-L28

};
/**
* A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
* SSR errors so they should simply be a passthrough.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function withErrorBoundary<P extends Record<string, any>>(
WrappedComponent: React.ComponentType<P>,
): React.FC<P> {
return WrappedComponent as React.FC<P>;
}

Fix in Cursor Fix in Web


@s1gr1d s1gr1d changed the title chore(tanstackstart-react): Remove empty placeholder implementations chore(tanstackstart-react)!: Remove empty placeholder implementations Nov 27, 2025
Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's alpha, we can break that (as you already wrote). I added a ! to the title to mark it as breaking.

@nicohrubec nicohrubec merged commit 9afaabf into develop Nov 27, 2025
34 checks passed
@nicohrubec nicohrubec deleted the nh/remove-tanstack-placeholders branch November 27, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants