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

Guard against unavailable captureStackTrace #33

Merged
merged 1 commit into from
Jun 4, 2017

Conversation

bigtiger
Copy link
Contributor

Error.captureStackTrace was unavailable in our react-native app. It did not cause a compile error but, rather it failed at runtime with the error:

Error.captureStackTrace is not a function. In 'Error.captureStackTrace(t,t.constructor)', 'Error.captureStackTrace' is undefined

Node Version: 6.6.0

@duhseekoh
Copy link

Yup... same issue... Lets merge this guy.

@duhseekoh
Copy link

Hack to get around this until its merged. Throw this somewhere in your code.

if(!Error.captureStackTrace) { // captureStackTrace is only available when debugging
  Error.captureStackTrace = () => {};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants