2

I have a react native expo managed app using react-native-sentry. According to the docs here: Sentry Expo Docs disabled by default in dev when encountering an error in dev it should be no op. I'm getting an error logged:

config Object {
  "debug": true,
  "defaultIntegrations": false,
  "deployEnvironment": "default",
  "dsn": "my-valid-dsn",
  "environment": "local",
}
[sentry-expo] Disabled Sentry in development. Note you can set Sentry.init({ enableInExpoDevelopment: true });

Sentry Logger [Error]:, [SentryError: SDK not enabled, will not capture event.]
at http://192.168.0.110:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:267225:41 in anonymous
at node_modules/sentry-expo/node_modules/@sentry/utils/dist/logger.js:26:4 in consoleSandbox
at http://192.168.0.110:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:267222:20 in anonymous
at node_modules/sentry-expo/node_modules/@sentry/utils/dist/syncpromise.js:72:26 in cachedHandlers.forEach$argument_0
at node_modules/sentry-expo/node_modules/@sentry/utils/dist/syncpromise.js:67:12 in _executeHandlers
at http://192.168.0.110:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:268617:30 in anonymous
at node_modules/sentry-expo/node_modules/@sentry/utils/dist/syncpromise.js:82:12 in SyncPromise
at http://192.168.0.110:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:268594:28 in anonymous
at http://192.168.0.110:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:274894:79 in anonymous
at node_modules/sentry-expo/node_modules/@sentry/hub/dist/hub.js:381:8 in Hub.prototype._invokeClient
at http://192.168.0.110:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:274350:24 in anonymous
at node_modules/sentry-expo/node_modules/@sentry/minimal/dist/index.js:16:28 in callOnHub
at node_modules/sentry-expo/node_modules/@sentry/minimal/dist/index.js:30:8 in captureException
at App.js:34:2 in App
at App.js:46:27 in initStripe
- ... 16 more stack frames from framework internals 

Code snippet:

export default function App() {
  console.log('config', getConfig().sentry);
  Sentry.init(getConfig().sentry);
  Sentry.Native.captureException(new Error("Oops!")); 

npm list sentry-expo

npm list sentry-expo
client@ /Users/blah/Repositories/blah-blah/client
└── sentry-expo@4.2.0

I expected no logging. Any help or advice would be appreciated!

jhuether
  • 31
  • 3
  • I'm pretty sure this jsut stops things going over to Sentry's own logging platform at sentry.io. Not that it stops your own logs from logging. – Wakka Jul 14 '22 at 22:55
  • @Wakka Thank you for the comment, I wasn't sure what to expect as it states no op and I initially took that to mean does absolutely nothing. If it's configured correct and working properly I might just wrap it in a conditional so it logs a normal error with message in console for dev instead of the current stack trace. – jhuether Jul 14 '22 at 23:43

0 Answers0