Unity WebGL 실행 시 Build.framework.js 오류 해결

hedev·2023년 2월 1일
0

Unity

목록 보기
1/1
post-thumbnail

유니티 WebGL로 게임 빌드한 후에 크롬 브라우저에서 실행했더니 undefined 오류가 발생했다.

TypeError: Cannot set properties of undefined (setting '1'),TypeError: Cannot set properties of undefined (setting '1') at _JS_WebRequest_Create (이후 생략)

관련 Unity Forum 글을 찾아보았다. Build.framework.js 파일을 수정하면 된단다.

핵심은 코드의 이 라인을 ▽

var wr = { requestInstances: {}, nextRequestId: 1, loglevel: 2 };

이렇게 바꿔주면 된다는 것이다. ▽

var wr = { requestInstances: {}, nextRequestId: 1, loglevel: 2, responses:{}, timer:{}, requests:{}, abortControllers:{} };

그렇게 수정하니 된다!

Build.framework.js 파일은 유니티가 빌드하면서 생성해주는 파일인데, 애초에 왜 오류가 있는 파일을 생성해주는지 의문이다.

profile
philosophia

0개의 댓글