1. 程式人生 > >React-Native 新版本無法Debug問題

React-Native 新版本無法Debug問題

最近無聊+手殘 升級rn到最新版本,然後出現了無法debug問題
具體症狀表現為

(index):94 Uncaught TypeError: Cannot set property 'volume' of null
    at Object.render ((index):94)
    at Object.setState ((index):48)
    at WebSocket.ws.onopen ((index):152)
render @ (index):94
setState @ (index):48
ws.onopen @ (index):152
(index
):188 Uncaught (in promise) TypeError: Cannot read property 'postMessage' of undefined at WebSocket.ws.onmessage ((index):188) ws.onmessage @ (index):188

開始以為跨域訪問導致,無腦改 谷歌瀏覽器設定,然並卵

後來各種百度,各種谷歌,各種qq,
最終解決方案
最新版本會根據配置的dubug伺服器地址開啟瀏覽器

so,只要把瀏覽器前面的ip地址改成 localhost就ok了

完美解決!!!