expo / sentry-expo

MIT License
202 stars 83 forks source link

TypeError: utils_1.isDebugBuild is not a function #315

Closed Jake-Mulhern closed 1 year ago

Jake-Mulhern commented 1 year ago

Summary

I am attempting to implement performance monitoring around some calls that are not working in production. In my development setup I followed the docs (https://docs.sentry.io/platforms/react-native/performance/instrumentation/custom-instrumentation/) and added the correlating statements but when I run the app I get the error:

Possible Unhandled Promise Rejection (id: 0):
TypeError: utils_1.isDebugBuild is not a function. (In 'utils_1.isDebugBuild()', 'utils_1.isDebugBuild' is undefined)

My code looks like this:

import * as Sentry from 'sentry-expo'

const handler = async () => {
                if (Constants['currentWallet']['chain'] === 'ETH') {
                  const transaction = Sentry.Native.startTransaction({ name: "get-eth-wallet-balances"});
                  const span = transaction.startChild({ op: "balances"});
                  let balances = await AlchemyUtils.getETHWalletBalances(Constants['currentWallet']['walletInstance'].address, Constants['userSettings']['currency']);
                  span.finish();
                  transaction.finish();
                }

I am also still getting the following errors but was getting these before implementing performance monitoring:

Sentry Logger [warn]:, [SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:
at node_modules/sentry-expo/node_modules/@sentry/integrations/node_modules/@sentry/utils/dist/logger.js:64:57 in consoleSandbox$argument_0
at node_modules/sentry-expo/node_modules/@sentry/integrations/node_modules/@sentry/utils/dist/logger.js:33:23 in consoleSandbox
at node_modules/sentry-expo/node_modules/@sentry/integrations/node_modules/@sentry/utils/dist/logger.js:62:34 in name
at node_modules/sentry-expo/node_modules/@sentry/react-native/dist/js/integrations/sdkinfo.js:28:31 in __awaiter$argument_3
at node_modules/tslib/tslib.js:113:68 in rejected

Sentry Logger [warn]:, [SentryError: Native is disabled]
at node_modules/sentry-expo/node_modules/@sentry/integrations/node_modules/@sentry/utils/dist/logger.js:64:57 in consoleSandbox$argument_0
at node_modules/sentry-expo/node_modules/@sentry/integrations/node_modules/@sentry/utils/dist/logger.js:33:23 in consoleSandbox
at node_modules/sentry-expo/node_modules/@sentry/integrations/node_modules/@sentry/utils/dist/logger.js:62:34 in name
at node_modules/sentry-expo/node_modules/@sentry/react-native/dist/js/integrations/sdkinfo.js:29:31 in __awaiter$argument_3
at node_modules/tslib/tslib.js:113:68 in rejected

Here are the package versions I am using:

"expo": "46.0.17",
"sentry-expo": "4.2.0",
"@sentry/react-native": "4.2.2",

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

46.0.17

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 13.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.17.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.15.0 - /usr/local/bin/npm Watchman: 2023.01.23.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.2/14C18 - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: ^0.17.0 => 0.17.4 expo: 46.0.17 => 46.0.17 react: 18.0.0 => 18.0.0 react-dom: 18.0.0 => 18.0.0 react-native: 0.69.6 => 0.69.6 react-native-web: ~0.18.7 => 0.18.11 npmGlobalPackages: eas-cli: 2.4.1 expo-cli: 6.0.5 Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

import React from 'react'; import * as AlchemyUtils from '../utils/AlchemyUtils.js';

const MyScreen = props = { useFocusEffect( React.useCallback(() => { const handler = async () => { const transaction = Sentry.Native.startTransaction({ name: "get-eth-wallet-balances"}); const span = transaction.startChild({ op: "balances"}); let balances = await AlchemyUtils.getETHWalletBalances(, 'USDT'); span.finish(); transaction.finish(); } }) ) }

kbrandwijk commented 1 year ago

Can't use the repro steps because of missing code that gets called.