Skip to content

Commit 8c6ad15

Browse files
authored
fix(remix): Don't log missing parameters warning on server-side. (#8269)
We are logging a warning when any of the required hooks / functions to Remix Browser SDK are not available in the Root component. This Root component is also rendered on server-side where we don't have access to those functions. And as we're not creating pageload / navigation transactions there, those functions are not required anyway. So this PR prevents that warning to be logged on server-side which is misleading.
1 parent c368bc8 commit 8c6ad15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/remix/src/performance/client.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { ErrorBoundaryProps} from '@sentry/react';
1+
import type { ErrorBoundaryProps } from '@sentry/react';
22
import { WINDOW, withErrorBoundary } from '@sentry/react';
33
import type { Transaction, TransactionContext } from '@sentry/types';
4-
import { logger } from '@sentry/utils';
4+
import { isNodeEnv, logger } from '@sentry/utils';
55
import * as React from 'react';
66

77
const DEFAULT_TAGS = {
@@ -101,6 +101,7 @@ export function withSentry<P extends Record<string, unknown>, R extends React.FC
101101
// Early return when any of the required functions is not available.
102102
if (!_useEffect || !_useLocation || !_useMatches || !_customStartTransaction) {
103103
__DEBUG_BUILD__ &&
104+
!isNodeEnv() &&
104105
logger.warn('Remix SDK was unable to wrap your root because of one or more missing parameters.');
105106

106107
// @ts-ignore Setting more specific React Component typing for `R` generic above

0 commit comments

Comments
 (0)