Skip to content

Not working on React Native #37

@brunolemos

Description

@brunolemos

After upgrading @octokit/rest from 16.22.0 to 16.43.1 support for react native was broken. The issue seems to come from universal-user-agent that is using some node-specific packages.

First error

Unable to resolve module os from "node_modules/os-name/index.js"
Cause:

import osName from "os-name";

Second error

TypeError: undefined is not an object (evaluating 'process.version.substr')
Cause:

return `Node.js/${process.version.substr(1)} (${osName()}; ${

If you make the react-native target be the same as web it will not crash but navigator.userAgent is undefined. You can get the Platform.OS from react-native.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions