2016-12-14 42 views
1

我試圖測試使用ReactNative發展,然後我試圖添加<br/>(因爲它是一個無效的成分)一個<Text>組件內部,它顯示了這樣的事情:如何使ReactNative堆棧跟蹤/錯誤信息更具可讀性

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null 
at launchEditor (/Users/user/Documents/AwesomeProject/node_modules/react-native/local-cli/server/util/launchEditor.js:153:29) 
at Object.handle (/Users/user/Documents/AwesomeProject/node_modules/react-native/local-cli/server/middleware/openStackFrameInEditorMiddleware.js:17:7) 
at next (/Users/user/Documents/AwesomeProject/node_modules/connect/lib/proto.js:174:15) 
at Object.handle (/Users/user/Documents/AwesomeProject/node_modules/react-native/local-cli/server/middleware/getDevToolsMiddleware.js:74:7) 
at next (/Users/user/Documents/AwesomeProject/node_modules/connect/lib/proto.js:174:15) 
at Object.handle (/Users/user/Documents/AwesomeProject/node_modules/react-native/local-cli/server/middleware/getDevToolsMiddleware.js:74:7) 
at next (/Users/user/Documents/AwesomeProject/node_modules/connect/lib/proto.js:174:15) 
at Object.compression [as handle] (/Users/user/Documents/AwesomeProject/node_modules/compression/index.js:205:5) 
at next (/Users/user/Documents/AwesomeProject/node_modules/connect/lib/proto.js:174:15) 
at IncomingMessage.<anonymous> (/Users/user/Documents/AwesomeProject/node_modules/react-native/local-cli/server/middleware/loadRawBodyMiddleware.js:20:5) 

和設備上:

screenshot

有沒有一種方法,以使其更易於讀取錯誤(該系列有問題)?

+0

有類似的問題。看起來像是一些內部的反應錯誤cli –

+0

你安裝了什麼版本的react-native-cli? –

+0

@ seba.wagner react-native-cli:1.3.0 – Kokizzu

回答

0

您應該定義REACT_EDITOR環境變量以允許RN運行您最喜歡的文本編輯器。最簡單的方法是運行類似env REACT_EDITOR=atom npm start的東西。或者你可以永久設置這個變量,只是谷歌how to set environment variable on ${OS}