iOS真機聯調紅屏報錯Error: EISDIR: illegal operation on a directory的解決方案
報錯信息
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:568:3)
at tryReadSync (fs.js:353:20)
at Object.readFileSync (fs.js:390:19)
臨時解決方案:搖一搖iPhone,彈出debug菜單,倒數第二項點進去,分別輸入PC端ip地址,8081,index,然後再reload就可以了
問題根源在debug模式沒有找到index bundle文件,檢查iOS原生部分jsCodeLocation的獲取是否有問題,例如下面的獲取方式裏index是否寫成了index.ios的老版本寫法
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"ind