Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled JS Exception: undefined is not an object (evaluating 'e.construct... #342

Closed
3 of 5 tasks
m-vdb opened this issue Jan 31, 2018 · 1 comment
Closed
3 of 5 tasks
Assignees

Comments

@m-vdb
Copy link

m-vdb commented Jan 31, 2018

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

v6.11.2
5.3.0
myproject@0.8.2 /Users/mvdb/Sources/myproject
├── lodash@4.17.4
├── moment@2.19.2
├── prop-types@15.6.0
├── qs@6.5.1
├── react@16.2.0
├── react-instantsearch@4.2.0
├── react-native@0.52.2
├── react-native-android-notification-permission@1.0.1
├── react-native-app-settings@2.0.0
├── react-native-calendar-strip@1.2.4
├── react-native-config@0.11.5
├── react-native-device-info@0.12.1
├── react-native-fabric@0.5.1
├── react-native-fbsdk@0.6.3
├── react-native-infinite-scroll-view@0.4.3
├── react-native-message-bar@2.0.6
├── react-native-modal-datetime-picker@4.13.0
├── react-native-parsed-text@0.0.20
├── react-native-push-notification@3.0.2
├── react-native-router-flux@4.0.0-beta.24
├── react-native-sentry@0.30.2
├── react-native-snap-carousel@3.4.0
├── react-native-splash-screen@3.0.6
├── react-native-store-view@3.1.0
├── react-native-swipeout@2.3.1
├── react-native-vector-icons@4.4.2
└── realm@1.13.0

Config:

Sentry.config(Config.SENTRY_DSN, {}).install()

I have following issue:

When calling Sentry.config() with an undefined dsn, it will crash with the Unhandled JS Exception: undefined is not an object (evaluating 'e.construct.... It is not an issue in debug configuration, since it is easy to read the stacktrace, but in release configuration it is a bit cryptic, since the backtrace is totally minified and it is hard to know where it comes from:

Unhandled JS Exception: undefined is not an object (evaluating 'e.construct..., stack:
config@307:921
<unknown>@305:6588
d@2:755
<unknown>@12:55
d@2:755
n@2:326
global code@939:8

I was able to narrow it down to the call to config() here by using a stack beautifier. (I spent some time trying to figure out why my build failed on TestFlight...).

It is rather easy to fix, we could just check for null and undefined too.

Steps to reproduce:
Sentry.config(undefined, {}).install()

Actual result:
Unhandled JS Exception: undefined is not an object (evaluating 'dsn.construct...

Expected result:
Sentry: A DSN must be provided

@HazAT HazAT self-assigned this Feb 7, 2018
@HazAT HazAT closed this as completed Feb 7, 2018
HazAT added a commit that referenced this issue Feb 7, 2018
@m-vdb
Copy link
Author

m-vdb commented Feb 7, 2018

thanks!

HazAT added a commit that referenced this issue Feb 7, 2018
* fix: Dsn type check

Fixes #342
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

No branches or pull requests

2 participants