3

This is the output I get when I run react-native start, and as you can see, it is giving a 404 error.

I have tried opening the page in chrome and it says Cannot GET /.

The app doesn't work on mobile either, even after connecting the device via wifi and entering the machine's IP address. It is stuck on the red screen saying Unable to load JS Bundle.

What's wrong?

   C:\Users\Abhishek\Desktop\SpeedRead>react-native start
     ┌────────────────────────────────────────────────────────────────────────────┐
     │  Running packager on port 8081.                                            │
     │                                                                            │
     │  Keep this packager running while developing on any JS projects. Feel      │
     │  free to close this tab and run your own packager instance if you          │
     │  prefer.                                                                   │
     │                                                                            │
     │  https://github.com/facebook/react-native                                  │
     │                                                                            │
     └────────────────────────────────────────────────────────────────────────────┘
    Looking for JS files in
       C:\Users\Abhishek\Desktop\SpeedRead

    [3:25:35 PM] <START> Building Dependency Graph
    [3:25:35 PM] <START> Crawling File System
    [3:25:35 PM] <START> Loading bundles layout
    [3:25:35 PM] <END>   Loading bundles layout (0ms)

    React packager ready.

    [3:25:44 PM] <END>   Crawling File System (9096ms)
    [3:25:44 PM] <START> Building in-memory fs for JavaScript
    [3:25:45 PM] <END>   Building in-memory fs for JavaScript (554ms)
    [3:25:45 PM] <START> Building in-memory fs for Assets
    [3:25:45 PM] <END>   Building in-memory fs for Assets (521ms)
    [3:25:45 PM] <START> Building Haste Map
    [3:25:46 PM] <START> Building (deprecated) Asset Map
    [3:25:46 PM] <END>   Building (deprecated) Asset Map (95ms)
    [3:25:49 PM] <END>   Building Haste Map (3482ms)
    [3:25:49 PM] <END>   Building Dependency Graph (13858ms)
    ::1 - - [31/Jan/2016:09:56:19 +0000] "GET / HTTP/1.1" 404 13 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"
    ::1 - - [31/Jan/2016:09:56:19 +0000] "GET /favicon.ico HTTP/1.1" 404 24 "http://localhost:8081/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"

Questions I have seen:

react native android failed to load JS bundle

But it doesn't work.

Community
  • 1
  • 1
code
  • 2,115
  • 1
  • 22
  • 46

1 Answers1

0

If you want to ensure the packager is loading you need to navigate to http://localhost:8081/js/index.android.bundle?platform=android. If you still get a 404 there something is most likely wrong with your network configuration.

If you can pull it up on the web, run this with your phone plugged in via USB adb reverse tcp:8081 tcp:8081.

BradByte
  • 11,015
  • 2
  • 37
  • 41