endel / NativeWebSocket

🔌 WebSocket client for Unity - with no external dependencies (WebGL, Native, Android, iOS, UWP)
Other
1.27k stars 161 forks source link

WebGL Build failed on Unity 2021.2 #53

Closed kentakang closed 2 years ago

kentakang commented 3 years ago

WebGL Build failed on Unity 2021.2

Error Log

Building Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js failed with output:
/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/tools/acorn-optimizer.js:1845
  throw err;
  ^

SyntaxError: Unexpected token (3707:62)
  var textEncoder={encoding:"utf-8",encode:encode(input = '') {
                                                              ^

    at Parser.pp$4.raise (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2927:15)
    at Parser.pp.unexpected (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:698:10)
    at Parser.pp.expect (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:692:28)
    at Parser.pp$3.parseObj (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2563:14)
    at Parser.pp$3.parseExprAtom (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2302:19)
    at Parser.pp$3.parseExprSubscripts (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2129:21)
    at Parser.pp$3.parseMaybeUnary (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2106:19)
    at Parser.pp$3.parseExprOps (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2041:21)
    at Parser.pp$3.parseMaybeConditional (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:2024:21)
    at Parser.pp$3.parseMaybeAssign (/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/node_modules/acorn/dist/acorn.js:1997:21) {
  pos: 137841,
  loc: Position { line: 3707, column: 62 },
  raisedAt: 137842
}
emcc2: error: '/Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/node/node /Applications/Unity/Hub/Editor/2021.2.0f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/tools/acorn-optimizer.js /var/folders/lf/dlnxxblj6113m9w7r2tw1p2r0000gn/T/emscripten_temp_o2qwpj5n/build.js.pp.js AJSDCE minifyWhitespace' failed (1)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:179)
endel commented 2 years ago

Thanks for reporting, this has been fixed on latest version!