[英]React-Native Cannot GET/ and JS Bundle
這是我運行react-native start
時得到的輸出,正如您所看到的,它給出了404錯誤。
我試過用chrome打開頁面,它說Cannot GET /
。
即使通過wifi連接設備並輸入設備的IP地址,該應用程序也無法在移動設備上運行。 它被困在紅色屏幕上說Unable to load JS Bundle.
怎么了?
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"
我看過的問題:
但它不起作用。
如果你想確保打包器正在加載你需要導航到http://localhost:8081/js/index.android.bundle?platform=android
。 如果您仍然獲得404,那么您的網絡配置很可能出現問題。
如果你可以在網上提起它,請在手機插入USB adb reverse tcp:8081 tcp:8081
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.