Skip to content

Importing Sentry causes error regarding fetch. #424

Description

@AndrewSouthpaw

Adding import Sentry from 'sentry-expo' to my App.js causes my app to crash:

Unhandled JS Exception: Requiring module "fetch", which threw an exception. 
TypeError: undefined is not an object (evaluating 'self.fetch').

Same problem happens if I simply import react-native-sentry.

Digging around, I've seen issues crop up in react-native here and fetch here and isomorphic-fetch here. AFAICT, isomorphic-fetch is the root of the problem, it's not maintained and didn't support React Native, and now people are moving to other packages (cross-fetch, fetch-everywhere, fetch-ponyfill, etc.) as a replacement.

Are other people running into this problem? Right now, following the Expo docs, I'm unable to get Sentry to work for React Native. 😞

Versions:

node: v8.4.0
npm: 5.6.0

"expo": "^27.0.2",
"react-native": "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/expo/react-native/archive/sdk-27.0.0.tar.gz",
"sentry-expo": "^1.9.0"

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions