Skip to content

Fetch not working on localhost (Tried IP too.) #17758

Description

@fahidmohammad

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: Windows 10
Node: 9.4.0
Yarn: 1.3.2
npm: 5.6.0
Android Studio: 3.0.1

Packages: (wanted => installed)
react-native: 0.52.0
react: 16.2.0

Target Platform: Android 26

Issue Statement

API from local server doesnt't seems to be working, i have tried localhost:3000, 10.0.2.2:3000, <LOCAL_IP>:3000 & 10.0.3.2:3000 In Android Getting network request failed error. Below is the code snippets im using for network request.

Note: I already added the Android Internet permission.

return fetch('http://192.168.3.148:3000/extension/auth')
        .then((response) => response.json())
        .then((responseJson) => {

            this.setState({
                isLoading: false,
                sem: responseJson
            });
        })
        .catch((error) => {
            console.error(error);
        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions