Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2020.3.48 WebGL build error #85

Open
BelieveXiaoShuai opened this issue Dec 11, 2024 · 1 comment
Open

2020.3.48 WebGL build error #85

BelieveXiaoShuai opened this issue Dec 11, 2024 · 1 comment

Comments

@BelieveXiaoShuai
Copy link

Version: 3.1.4
Unity Version: 2020.6.48
Platform: WebGL
Build Error:Failed process stderr log:
emcc: warning: cannot represent a NaN literal '0x237558f35b0' with custom bit pattern in NaN-canonicalizing JS engines (e.g. Firefox and Safari) without erasing bits!
in %144 = select i1 %.0182.off0, double 0xFFF8000000000000, double 0x7FF8000000000000 in _ZNK17double_conversion23StringToDoubleConverter12StringToIeeeIPKcEEdT_ibPi()

JS optimizer error:
Unexpected token: keyword (const) (line: 2747, col: 19, pos: 106831)

================================

}

var uLipSync={unityCsharpCallback:null,resumeEventNames:["keydown","mousedown","touchstart"],userEventCallback:function () {
Module.dynCall_v(uLipSync.unityCsharpCallback);
for (const ev of uLipSync.resumeEventNames) {
^

D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:282
throw new JS_Parse_Error(message, line, col, pos);
^
Error
at new JS_Parse_Error (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:260:22)
at js_error (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:282:15)
at croak (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:752:17)
at token_error (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:760:17)
at unexpected (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:766:17)
at D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:1131:17
at maybe_unary (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:1220:27)
at expr_ops (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:1247:32)
at maybe_conditional (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:1251:28)
at maybe_assign (D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:1275:28)
at D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\eliminator\node_modules\uglify-js\lib\parse-js.js:1289:28
ERROR:root:'D:/Unity/2020.3.48f1/Editor/Data\Tools\nodejs\node.exe --stack_size=8192 --max-old-space-size=4096 D:\Unity\2020.3.48f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\js-optimizer.js C:\Users\asus\AppData\Local\Temp\tmp_selij\build.bc.o.js.pp.js.mem.js noPrintMetadata AJSDCE minifyWhitespace' failed
image

@hecomi
Copy link
Owner

hecomi commented Dec 31, 2024

In Unity 2020.X, the Emscripten version is outdated, and the const keyword on the JavaScript side cannot be used, so unfortunately, it won’t work. It should function properly with Unity 2021.2 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants