2

개발 용 Android 애플리케이션에 반응 네이티브를 사용합니다.크롬 오류에서 반응 네이티브 디버그

Launching Dev Tools... 
ERROR Wrong length! 
RangeError: Wrong length! 
    at validateArrayBufferArguments (/Users/sergiigetman/IdeaProjects/mbc_kidsvod_client/node_modules/babel-polyfill/node_modules/core-js/modules/_typed-buffer.js:157:39) 
    at new ArrayBuffer (/Users/sergiigetman/IdeaProjects/mbc_kidsvod_client/node_modules/babel-polyfill/node_modules/core-js/modules/_typed-buffer.js:247:29) 
    at createUnsafeArrayBuffer (buffer.js:43:12) 
    at createUnsafeBuffer (buffer.js:37:25) 
    at allocate (buffer.js:199:12) 
    at Function.Buffer.allocUnsafe (buffer.js:162:10) 
    at new Buffer (buffer.js:93:19) 
    at BufferPool.reset (/Users/sergiigetman/IdeaProjects/mbc_kidsvod_client/node_modules/ws/lib/BufferPool.js:57:26) 
    at Receiver.endPacket (/Users/sergiigetman/IdeaProjects/mbc_kidsvod_client/node_modules/ws/lib/Receiver.js:247:68) 
    at Receiver.finish (/Users/sergiigetman/IdeaProjects/mbc_kidsvod_client/node_modules/ws/lib/Receiver.js:483:12) 

이 유사한 문제를 발견하지 않았습니다 : 응용 프로그램이 실행되면, 그때는 충돌 앱 반응 네이티브 개발자 메뉴에서 Debug in Chrome를 선택하려고하지만, 콘솔, 내가 명령 react-native start을 실행 어디서보고 오류 스택 및 인터넷에.

+0

'babel-polyfill'과 비슷한 모양인데 비슷한 문제가 발견되었지만 https://github.com/zzarcon/microm/issues/22도 도움이되지 않습니다. –

+0

동일한 문제가 발생하여 수동으로로드 중 "http : // localhost : 8081/debugger-ui"가있는 Chrome은 '사이트에 연결할 수 없음'을 나타내며 로컬 포트가 다운되었음을 나타냅니다. 우리는 이전 버전의 반응 네이티브 (0.22)를 사용하고 있지만이 문제가 관련되어 있다는 징후는 없습니다. – bitsand

+0

@bitsand 안녕하세요, 답변 해 주셔서 감사합니다. 사실 나는 배열 버퍼 길이를 검사하고 더 진행하는 문장을 주석 처리했습니다. 나는 그것이 권장되지는 않지만 제 js 세계에서 작동한다는 것을 알고 있습니다 –

답변

1

이 오류를 재현 할 수 있었고 이전 버전의 React Native (0.22.x)를 babel-polyfill 버전 6.16.0과 함께 실행 한 결과로 엣지 케이스처럼 보입니다. React Native (0.40.0) 및 Babel Polyfill (6.20.0)의 현재 버전에서는 오류가 발생하지 않습니다. 관련성이 있다고는 생각하지 않지만 노드 7.2.0을 실행 중입니다.

환경을 업데이트 할 수없는 경우 일시적인 해결 방법은 'babel-polyfill/node_modules/core-js/modules/_typed-buffer.js'를 편집하고 해당 줄의 157 및 175 번 버퍼 검사를 수정하는 것입니다 파일 : 당신이 바벨 - polyfill 6.20.0를 실행하는 경우

if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); 

다음 파일이 여기에있을 것입니다 : 우리는이 길이 체크를 주석에 의해 작동하는 우리의 dev에 환경을 얻을 수있었습니다

node_modules/core-js/modules/_typed-buffer.js 

out하지만주의 할 것은 emptor이고, 아마도 이것을 생산에 들여 놓고 싶지는 않을 것입니다.

+0

네, 그 라인에 주석을 달아 정확히 해결했습니다. –

관련 문제